This toolbox was developed to provide computational neuroscientists and neuromorphic engineers with a playground for implementing neural algorithms which are simulated using Brian 2.
teili, das /taɪli/, Swiss german diminutive for piece.
This toolbox was developed to provide computational neuroscientists and neuromorphic engineers with a playground for implementing neural algorithms which are simulated using brian2.
Please report issues via the gitlab issue tracker. You can find the documentation here.
By providing pre-defined neural algorithms, a contributing guide to create novel neural algorithms and an intuitive way to combine different aspects of those neural algorithms, e.g. plasticity, connectivity etc, we try to shorten the development time required to test and implement novel neural algorithms and hierarchically assemble them. Furthermore, by providing an easy and modular way to construct those algorithms from the basic building blocks of computaton, e.g. neurons, synapses and EI-networks, we aim to promote the development of reproducible computational models and networks thereof. Additionally we aim to reduce the gap between software simulation and specific hardware emulation/implementation by an easy way to switch neuron/synapse models in a highly complex building block of a developed neural algorithm.
This toolbox is still in its alpha phase, so if you want to use it, follow the install instructions below. Please also contact the main contributors with feedback.
Please look at the examples here:
~/teiliApps/tutorials/ after successfully installing teili and our Documentation
Create a virtual environment using conda
# Replace myenv with the desired name for your virtual environment conda create --name myenv python=3.7
If you want to use a specific version, as needed e.g. to use CTXLCTL add the particular python version to the conda environment
conda create --name myenv python=3.6.6
Activate your conda environment
source activate myenv
If you want to use the stable release simply run:
pip install teili
To get all tutorials, unit tests and statically defined neuron and synapse models please run (simply inside your terminal)
python -m teili.tools.generate_teiliApps
git clone https://gitlab.com/neuroinf/teili.git
Navigate to the parent folder containing the cloned repository or the downloaded
Install teili using pip
# Point pip to the location of the setup.py pip install teili/ # or point pip to the downloaded tar.gz file pip install teili*.tar.gz
setup.pywill by default create a folder in your home directory called
teiliApps(if you use the source files teiliApps will be automocally generated. In case of the stable release from pypi.org you need to manually call the function to generate teiliApps as described above). This folder contains a selection of neuron and synapse models, example scripts, as well as unit tests. Please run the unit tests to check if everything is working. As we test also plotting functionality of teili we generate and kill plotting windows which causes warnings.
cd ~/teiliApps/ python -m unittest discover unit_tests/
If you run the above command and the last line states
Ran 78 tests in 93.373 OK, everything is good. You are good to go!
You probably need to use Linux if you want to use standalone code generation, otherwise, Windows and Mac OSX works fine.
from brian2 import ms from teili import Neurons, Connections from teili.models.neuron_models import DPI from teili.models.synapse_models import DPISyn # how to create a Neuron num_neurons = 10 refP = 3 * ms Neuron1 = Neurons(num_neurons, equation_builder=DPI(numInputs=1), refractory=refP, name='Neuron1') # how to create a Synapse Synapse1 = Connections(Neuron1, Neuron1, equation_builder=DPISyn(), method='euler', name='Synapse1')
For a more detailed explanation have a look at our Tutorial
Please look at the Neuron & Synapse tutorial, which is located in
You can also use them to test your installation.
To run an example and test if eveything is working, run the following command
cd ~/teiliApps/examples/ python3 neuron_synapse_test.py
For more examples and use cases have look at our Documentation
Brian2 debugging tips
Simulation is not going as expected?
- Restart Python kernel
- Are all groups added to the network?
- Are all statevars initialized with the correct value? (e.g. Membrane potential with resting potential, not 0)
- Use group.print() in order to see the equations
- Use connections.plot() in order to get a visualization
See here for a list of the authors.
teili is licenced under the MIT license, see the
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.