DendriNet (Python package dendritic_modeling) is a PyTorch library for
neural networks built from dendritic neurons. Each neuron is a tree of branch
compartments with sparse excitatory and inhibitory synapses, combined by
shunting or additive integration and passed through reactivation gates.
Population networks arrange such neurons in named excitatory and inhibitory
populations, feedforward or recurrent, with optional receptor synapse types,
spiking somas, dendritic spikes and soma-to-dendrite feedback. The library
also provides matched point-neuron and recurrent baselines, training by
backpropagation, feedback alignment and local credit-assignment rules,
distributed training, parameter sweeps and analysis tools.
For the graphical editor, go straight to DendriNet Studio. For the Python library and command-line tools, install the core from PyPI in a Python 3.10 or later environment.
python -m pip install dendritic-modeling==0.5.0The import name is dendritic_modeling. The examples run on a CPU.
The installation guide covers virtual environments, CPU and CUDA builds
of PyTorch, optional dependencies and editable installs for contributors.
PyPI release ·
Installation guide
Studio lets you draw feedforward and recurrent networks, inspect a neuron's dendrites and compare runs in your browser. Open a terminal on your laptop. On an Apple silicon Mac or a Linux laptop with Python 3.10 or later, run these commands the first time. Installing Studio also installs DendriNet and PyTorch. On a Mac, use the arm64 build of Python.
python3 -m venv ~/dendrinet-env
source ~/dendrinet-env/bin/activate
python -m pip install dendrinet-studio==0.1.0
dendrinet-studio --workspace ~/dendrinet-runsIf you use Conda on macOS or Linux, replace the first two lines with
conda create -n dendrinet python=3.11 -y and conda activate dendrinet.
Windows PowerShell instructions
Keep the terminal open. If a browser tab doesn’t open, paste the entire
printed address, including the part after #, into your browser.
- In Model → Start from, open Two-class population network. Select population e to see which inputs provide excitation and inhibition.
- Choose CPU and click Check model. In Training, set Epochs
to
1. Click Train, name the run and select Start training. - Open Runs to see the loss and training log. The example generates
its own data and saves the run in
~/dendrinet-runs.
Press Ctrl+C in the terminal to stop Studio. Next time, activate the
same environment and repeat the dendrinet-studio --workspace command above
to see your saved runs. The editor also exports YAML for dendritic-train.
Illustrated Studio guide ·
Studio on PyPI
After installation, export a small configuration into any working directory:
# Generate data locally and train a small population network
dendritic-example synthetic_population --output demo.yaml
dendritic-train demo.yaml --epochs 1
# Check a configuration without training
dendritic-train demo.yaml --validate-only
# From a repository checkout, generate a parameter sweep without submitting jobs
dendritic-sweep --config configs/sweep_config.yaml --generate-onlyThe installed commands include dendritic-train (training),
dendritic-sweep and dendritic-analyze (sweeps and their results),
dendritic-analyze-checkpoint (analysis of a trained checkpoint) and
dendritic-compact-checkpoint (compact export of a trained model);
docs/cli_reference.rst lists every command and its
options. Distributed training runs under torchrun; see
docs/distributed_training.rst.
The documentation is built with Sphinx from docs/:
pip install -e ".[docs]"
python -m sphinx -b html -W --keep-going docs docs/_build/htmlStart with:
- Installation and Quickstart
- Example configurations
- Model overview and the component catalogue
- Training strategies, datasets and analysis
- Runs and outputs and configuration files
src/dendritic_modeling/: the library (configuration, datasets, networks, training, analysis, deployment, command-line programs); docs/engineering_architecture.rst maps it.configs/: reference and example configurations.docs/: documentation sources.tests/: the pytest suite.setup/: conda environment file and pinned constraints.scripts/train_fsdp.sh: a Slurm launcher for FSDP training.
See docs/contributing.rst and CHANGELOG.md.
MIT. See LICENSE.
