160 likes | 270 Views
http://brian.di.ens.fr. Dan Goodman & Romain Brette Ecole Normale Supérieure Projet Odyssée. goodman@di.ens.fr brette@di.ens.fr. Brian: a pure Python simulator. What is Brian for? Networks of spiking neurons Quick model coding Flexibility: equations-oriented Easy to learn and intuitive
E N D
http://brian.di.ens.fr Dan Goodman & Romain Brette Ecole Normale Supérieure Projet Odyssée goodman@di.ens.fr brette@di.ens.fr
Brian: a pure Python simulator What is Brian for? • Networks of spiking neurons • Quick model coding • Flexibility: equations-oriented • Easy to learn and intuitive • Teaching What is Brian not for? (yet!) • Very large-scale network models (distributed) • Detailed biophysical models
Brian in action Ci P Pi Pe Ce
Flexibility: adaptive threshold Threshold increases when spike arrives and decays Implemented as DE and user-defined reset and threshold functions
Performance • Python is interpreted, but Brian uses NumPy for fast vector operations • Python overheads add up to O(1/dt) • For large N, relative performance improves • Faster than Matlab, not much slower than C++ (1.7x) • In the works: using the GPU, early tests show 60x speed up!
Interoperability • General points • Code versus description languages • Python • Brian’s interoperability • Brian’s data types • PyNN • NeuralEnsemble • Computational neuroscience cookbook • Piquant units package
Code versus description • Simulator independence • Description languages like NeuroML do this best • PyNN also does this, but forces you to use Python • Flexibility • Code more flexible than description languages in general • But SBML uses MathML for flexibility • Code still necessary (for many problems) • When code is necessary, use Python! • Easy to learn and powerful • Works on all platforms • Many simulators support it, and there is PyNN • Also quite efficient
Python and data types • Brian is pure Python, so runs on almost any platform, and all of its output can be used with any Python package, e.g. • NumPy (numerical) • SciPy (scientific) • PyLab (plotting) • Brian’s output data types: • Quantities with physical dimensions: Quantity class derived from float, so easily compatible • Arrays with units: qarray class derived from numpy.ndarray, so easily compatible • Will talk more about Quantity and qarray later • Spike trains are lists of tuples (i,t) indicating that neuron i fired at time t
PyNN • PyNN.brian in development • Brian’s data structures easily compatible with PyNN, e.g. spike trains are exactly the same • Through PyNN will get support for many other things, e.g. • NeuroML • FacetsML
NeuralEnsemble and Cookbook • NeuralEnsemble projects are in Python, so compatibility with Brian is good • Brian data can be analysed with NeuroTools • Computational neuroscience cookbook will facilitate code sharing and interoperability, see it at http://neuralensemble.org/cookbook
Piquant units package • Brian’s units module released as a stand-alone package Piquant, available at http://sourceforge.net/projects/piquant/ • Idea is to have a standard package for single quantities and arrays with units for interoperability • Piquant works by • Building on NumPy data types • Quantity derived from float • qarray derived from numpy.ndarray • Current implementation • Single quantities good and reasonably stable • qarray slow and slightly patchy implementation, needs to be rewritten • Looking for volunteers to help (get in touch!)
Thanks! Make sure to check out... http://brian.di.ens.fr http://neuralensemble.org/cookbook http://sourceforge.net/projects/piquant/
Piquant ideas • Quantity • Deriving from float seems like a good idea, probably won’t change • Standard SI names: volt, amp, etc. • Standard SI prefixes: mvolt, namp, etc. • Some short names: mV, nA, etc. • qarray • Current implementation has arrays with homogeneous units, or inhomogeneous • Homogeneous fairly fast, just store one unit • Inhomogeneous uses ndarray with dtype=object, very slow • Could use NumPy’s broadcasting rule for more flexible homogeneity • Underlying array of floats X • Array of units U that should be broadcastable to X, e.g. one unit for each row of X, or one unit for each column of X • Performance? • Compatibility with NumPy and SciPy?