120 likes | 231 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? Quick model coding for every day use Easy to learn and intuitive Equations-oriented: flexible
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? • Quick model coding for every day use • Easy to learn and intuitive • Equations-oriented: flexible What is Brian not for? • Very large-scale network models (distributed) • Very 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, performance improves • Faster than Matlab, not much slower than C++ (1.7x)
Interoperability • Python • Brian’s data types • PyNN • NeuralEnsemble • Computational neuroscience cookbook • Piquant units package
Python and data types • Brian is pure Python, 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 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!)
Piquant ideas (time allowing) • 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?