Email updates

Keep up to date with the latest news and content from BMC Neuroscience and BioMed Central.

This article is part of the supplement: Seventeenth Annual Computational Neuroscience Meeting: CNS*2008

Open Access Poster presentation

Brian: a simulator for spiking neural networks in Python

Dan Goodman* and Romain Brette

Author Affiliations

Odyssee Lab (INRIA/ENS/ENPC), Département d'Informatique, Ecole Normale Supérieure, 45, rue d'Ulm, 75230 Paris Cedex 05, France

For all author emails, please log on.

BMC Neuroscience 2008, 9(Suppl 1):P92  doi:10.1186/1471-2202-9-S1-P92

The electronic version of this article is the complete one and can be found online at: http://www.biomedcentral.com/1471-2202/9/S1/P92


Published:11 July 2008

© 2008 Goodman and Brette; licensee BioMed Central Ltd.

Poster presentation

We present Brian, a new clock driven simulator for spiking neural networks which is available on almost all platforms. Brian is easy to learn and use, highly flexible and easily extensible. The Brian package itself and simulations using it are all written in the Python programming language, which is very well adapted to these goals. Python is an easy, concise and highly developed language with many advanced features and development tools, excellent documentation and a large community of users providing support and extension packages. Brian allows you to write very concise, natural and readable code for simulations, and makes it quick and efficient to play with these models (for example, changing the differential equations doesn't require a recompile of the code). Figure 1 shows an example of a complete network implemented in Brian, a randomly connected network of integrate and fire neurons with exponential inhibitory and excitatory currents (the CUBA network from [1]). Defining the model, running the simulation and making a raster plot of the activity takes fifteen lines of code. Amongst Brian's features are:

Flexible neuron models: these can be defined in many ways, notably by directly providing differential equations (including stochastic DEs), or modularly, using standard components like ion channels and alpha function postsynaptic currents.

Built in analysis and plotting: using the SciPy and PyLab scientific computing and plotting packages.

Unit checking: equations and quantities are checked for dimensional consistency, which helps to eliminate scaling errors and incorrect equations which can otherwise be very hard to debug.

Interactive simulations: Using the Python interactive shell, running simulations, changing aspects of the model, plotting and analysis can all be done interactively rather than requiring the network to be run afresh each time.

Extensibility: Since Brian is written in the same high level language as simulations using it, it is easy to write extensions to Brian and share them with others.

Python is an interpreted language which means that it is slower than code written directly in C, but by using the NumPy package for highly optimised linear algebra it ends up comparable in speed to C code for large networks. The random network described above with 4000 neurons took 3.5 s to simulate 1 s of biological time, which was roughly 60% faster than Matlab, and 25% slower than C.

thumbnailFigure 1. Brian in action.

References

  1. Brette R, Rudolph M, Carnevale T, Hines M, Beeman D, Bower JM, Diesmann M, Morrison A, Goodman PH, Harris FC, et al.: Simulation of networks of spiking neurons: a review of tools and strategies.

    J Comput Neurosci 2007, 23(3):349-398. PubMed Abstract | Publisher Full Text OpenURL