Skip to content

Official code implementation of the paper on adaptive node position in biological transport networks

License

Notifications You must be signed in to change notification settings

kirkegaardlab/gradnodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adaptive Node Positioning in Transport Networks

This repository contains the code used in the paper "Adaptive Node Positioning in Biological Transport Networks".

Setup

python3 -m venv venv
source venv/bin/activate
python3 -m pip install -r requirements
python3 -m pip install jax[cuda12] # In case of GPU available

Run

To run the code, just type

python optimize.py

This will create a folder with the current time inside runs/, e.g., runs/2024-05-06_112929, which it will make if it doesn't exist. There, it will save the arrays of the network and some results on npz files inside the arrays/ directory.

Some options (python optimize.py --help)

  -h, --help            show this help message and exit
  --gamma GAMMA         The exponent of the power dissipation.
  --n_nodes N_NODES     The number of nodes in the network.
  --learning_rate LEARNING_RATE, -lr LEARNING_RATE
                        The learning rate of the optimizer.
  --init_noise INIT_NOISE, -in INIT_NOISE
                        Initial noise to the positions
  --num_iters NUM_ITERS
                        The number of iterations.
  --rtol RTOL           Relative tolerance for convergence.
  --atol ATOL           Absolute tolerance for convergence.
  --beta BETA           The β parameter of the leaf.
  --theta THETA         The rotation of the leaf.
  --save_interval SAVE_INTERVAL
                        Interval to save the network.
  --out OUT             Output folder to save the results.
  --name NAME           Name of the run.
  --seed SEED           Seed for the random number generator.

To visualize the network one can use (PS: You need to have ffmpeg installed)

python visual.py

LICENSE

MIT License

About

Official code implementation of the paper on adaptive node position in biological transport networks

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 3

  •  
  •  
  •  

Languages