Skip to main content

This toolbox was developed to provide computational neuroscientists and neuromorphic engineers with a playground for implementing neural algorithms which are simulated using Brian 2.

Project description

teili

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.

Getting Started

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

Installation

  • 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
    
  • If you want to work with the latest version of teili clone the repository or download the tar.gz file

    git clone https://code.ini.uzh.ch/ncs/teili.git
    
  • Navigate to the parent folder containing the cloned repository or the downloaded tar.gz file

    cd Downloads/
    
  • 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
    

    The setup.py will 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!

We would recommend using iPython with Spyder orJupyter as IDE, but any other editior/IDE is fine as well.

You probably need to use Linux if you want to use standalone code generation, otherwise, Windows and Mac OSX works fine.

Basic usage

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

Tutorials

Please look at the Neuron & Synapse tutorial, which is located in ~/teiliApps/tutorial/. 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

Authors

See here for a list of the authors.

License

teili is licenced under the MIT license, see the LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for teili, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size teili-1.0.1-py3-none-any.whl (247.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size teili-1.0.1.tar.gz (368.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page