| Literature DB >> 19198667 |
Jochen Martin Eppler1, Moritz Helias, Eilif Muller, Markus Diesmann, Marc-Oliver Gewaltig.
Abstract
The neural simulation tool NEST (http://www.nest-initiative.org) is a simulator for heterogeneous networks of point neurons or neurons with a small number of compartments. It aims at simulations of large neural systems with more than 10(4) neurons and 10(7) to 10(9) synapses. NEST is implemented in C++ and can be used on a large range of architectures from single-core laptops over multi-core desktop computers to super-computers with thousands of processor cores. Python (http://www.python.org) is a modern programming language that has recently received considerable attention in Computational Neuroscience. Python is easy to learn and has many extension modules for scientific computing (e.g. http://www.scipy.org). In this contribution we describe PyNEST, the new user interface to NEST. PyNEST combines NEST's efficient simulation kernel with the simplicity and flexibility of Python. Compared to NEST's native simulation language SLI, PyNEST makes it easier to set up simulations, generate stimuli, and analyze simulation results. We describe how PyNEST connects NEST and Python and how it is implemented. With a number of examples, we illustrate how it is used.Entities:
Keywords: Python; integrate-and-fire neuron; large-scale simulation; modeling; networks; programming; scientific computing
Year: 2009 PMID: 19198667 PMCID: PMC2636900 DOI: 10.3389/neuro.11.012.2008
Source DB: PubMed Journal: Front Neuroinform ISSN: 1662-5196 Impact factor: 4.081
Figure 1Results of the example simulation. (A) The transcript of the simulation session shows the intermediate results of r_target as bisect() searches for the optimal rate. (B) The membrane potential of the target neuron as a function of time. Repeated adjustment of the spike rate of the inhibitory population by bisect() results in a convergence of the mean membrane potential to −112 mV, corresponding to an output spike rate of 5.0 Hz.
Figure 2Sequence diagram showing the interaction between Python and SLI. A call to the PyNEST high-level function Create() first transmits the model name to SLI using sli_run(). It is converted to the SLI type literal by the interpreter (). Next, it pushes the number of nodes (10) to SLI using sli_push(). The PyNEST low-level API converts the argument to a SLI datum () and pushes it onto SLI's operand stack. Next, it executes appropriate SLI code to create the nodes of type iaf_neuron in the simulation kernel. Finally it retrieves the results of the NEST operations using sli_pop(), which converts the data back to a Python object (). The result of the operation in SLI (the id of the last node created) is used to create a list with the ids of all new nodes, which is returned to Python.
Figure 3Class diagram for the acyclic visitor pattern used to convert SLI types to Python types. The left rectangle contains classes belonging to NEST, the right rectangle contains classes that are part of PyNEST. All SLI data types are derived from the base class Datum and inherit its function use_converter(). The class DatumConverter is the base class of DatumToPythonConverter. The actual data conversion is carried out in one of DatumToPythonConverter's convert_me() functions. Virtual functions are typeset in italics.
Figure 4Sequence diagram of the acyclic visitor pattern for data conversion from SLI to Python. For the conversion of a SLI datum d, sli_pop() creates an instance of DatumToPythonConverter. It then calls the DatumToPythonConverter's convert() function, which passes itself as a visitor to the use_converter() function of d. Datum::use_converter() calls the DatumToPythonConverter's convert_me() function that matches d's type. convert_me() creates a new Python object from the data contained in d. The new Python object is returned to sli_pop().