Initial release of `cuBNM` toolbox, a Python wrapper of C++ and CUDA code which runs simulations of biophysical network models of the brain on GPUs (and CPUs) and performs parameter optimization.
Features
- `cuBNM.sim.SimGroup`: enables defining model input data and parameters, runs single/multiple simulations in parallel on GPU/CPU (will use GPU by default if available), and calculates goodness of fit of the simulation to empirical data. This class directly interacts with the C++ extension in `cuBNM.core.run_simulations`.
- `cuBNM.optimizer.GridSearch`: runs simulation of a grid of the parameter space and calculates their goodness of fit.
- `cuBNM.optimizer.RWWProblem`: enables defining model input data, free parameters and their range. Local parameters can be regionally variable based on weights of fixed maps, or different free local parameters per each node or group of nodes.
- `cuBNM.optimizer.Optimizer`: a group of evolutionary optimizer classes which aim to solve the `cuBNM.optimizer.RWWProblem` by finding the optimal set of free parameters. Most of the optimizers are implemented by `pymoo`, and all of the `pymoo` optimizers (including those not included in the toolbox) can work with `cuBNM.optimizer.RWWProblem` since it inherits from `pymoo.core.problem.Problem`. Currently CMAES, NSGA-II and Bayesian optimizers are available. Only CMAES has been tested in practice and the other optimizers are at an experimental stage.
- `cuBNM.datasets`: loads test data including SC, FC and FCD and heterogeneity maps.
- The core C++ and CUDA code can is compiled with the compiler flags `NOISE_SEGMENT` by default, which precalculates a 30s segment of Gaussian noise which is reused in the simulation with shuffling after each repeat.
There is currently no documentation/tutorials but the doc strings and `./examples/examples.py` will be helpful.
Known Issues
- Binary wheels have been built for `manylinux_2_28` and should support a wide range of Linux systems, but they may not work. In that case it is recommended to build the toolbox from source. Also currently Windows and Mac are not supported but in theory using Docker GPU/CPU simulations on Windows and CPU simulations on Mac should work.
- Binary wheels also cannot do parallel simulations on CPU because they are not compiled with OpenMP (due to manylinux constraints). To enable this functionality the toolbox should be built from source.
- CPU simulations without FIC cause segmentation fault.