Skip to content
KempnerInstitutePublic

About

A biologically inspired neural network framework that implements dendritic computation through specialized processing of excitatory and inhibitory inputs.

Topics

Resources

Contributing

Stars

2 stars

Watchers

3 watching

Forks

Repository files navigation

DendriNet

CI Pipeline Coverage Documentation License: MIT Python 3.10+

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.

Three panels, left to right: a pyramidal neuron with basal and apical dendrites, excitatory synapses as dots on spines and inhibitory synapses as bars across the dendrite; the same neuron as a DendriNet tree of compartments on a triangular soma, each distal compartment receiving sparse excitatory and inhibitory inputs; and a two-layer network in which inputs drive excitatory neurons (triangular somata) and inhibitory neurons (round somata), inhibitory neurons inhibit the dendrites of neighbouring excitatory neurons, and excitatory neurons project to the next layer and the readout.

Installation

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.0

The 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

DendriNet Studio

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-runs

If 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.

  1. In Model → Start from, open Two-class population network. Select population e to see which inputs provide excitation and inhibition.
  2. Choose CPU and click Check model. In Training, set Epochs to 1. Click Train, name the run and select Start training.
  3. 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

First steps

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-only

The 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.

Documentation

The documentation is built with Sphinx from docs/:

pip install -e ".[docs]"
python -m sphinx -b html -W --keep-going docs docs/_build/html

Start with:

Repository layout

  • 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.

Contributing

See docs/contributing.rst and CHANGELOG.md.

License

MIT. See LICENSE.

About

A biologically inspired neural network framework that implements dendritic computation through specialized processing of excitatory and inhibitory inputs.

Topics

Resources

Contributing

Stars

2 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages