Springe zum Hauptinhalt

Neurosimulator ANNarchy
ANNarchy (Artificial Neural Networks architect)

ANNarchy (Artificial Neural Networks architect)

ANNarchy is a parallel simulator for distributed rate-coded or spiking neural networks. The definition of the network is declared in Python, but the library generates optimized C++ code to actually run the simulation in parallel, using either openMP (on multicore CPU architectures) or CUDA (on GPUs). The current stable version is 4.6 and is released under the GNU GPL v2 or later.

The code is available at:

The documentation is available at:

Core principles

ANNarchy separates the description of a neural network from its simulation. The description is declared in a Python script, offering high flexibility and readability of the code, and allowing to use the huge ecosystem of scientific libraries available with Python (Numpy, Scipy, Matplotlib, Sympy, Cython). Using Python furthermore reduces the programming effort to a minimum, letting the modeller concentrate on network design and data analysis.

A neural network is defined as a collection of interconnected populations of neurons. Each population comprises a set of similar artificial neurons (rate-coded or spiking point-neurons), whose activity is ruled by one or many ordinary differential equations. The activity of a neuron depends on the activity of other neurons through synapses, whose strength can evolve with time depending on pre- or post-synaptic activities (synaptic or plasticity). Populations are interconnected with each other through projections, which contain synapses between two populations.

ANNarchy provides a set of classical neuron or synapse models, but also allows the definition of specific models. The ordinary differential equations (ODE) governing neural or synaptic dynamics have to be specified by the modeler. Contrary to other simulators (except Brian) which require to code these modules in a low-level language, ANNarchy provides a mathematical equation parser which can generate optimized C++ code depending on the chosen parallel framework. Bindings from C++ to Python are generated thanks to Cython (C-extensions to Python), which is a static compiler for Python. These bindings allow the Python script to access all data generated by the simulation (neuronal activity, connection weights) as if they were simple Python attributes. However, the simulation itself is independent from Python and its relatively low performance.

Example of a pulse-coupled network of Izhikevich neurons

To demonstrate the simplicity of the interface of ANNarchy, here is the Hello, World! of spiking networks: the pulse-coupled network of Izhikevich neurons (Izhikevich, 2003). It can be defined in ANNarchy as:


  • 1.0: Initial version, purely C++.
  • 1.1: Management of exceptions.
  • 1.3: Parallelization of the computation using openMP.
  • 2.0: Optimized version with separated arrays for typed connections.
  • 2.1: Parallelization using CUDA.
  • 2.2: Optimized parallelization using openMP.
  • 3.0: Python interface to the C++ core using Boost::Python.
  • 4.0: Python-only version using Cython for the interface to the generated C++ code.

Relevant Publications

Vitay, J., Dinkelbach, H.Ü., Hamker, F.H. (2015). ANNarchy: a code generation approach to neural simulations on parallel hardware. Frontiers in Neuroinformatics 9, 19. doi:10.3389/fninf.2015.00019. PDF-document

Dinkelbach, H.Ü., Vitay, J., Beuth, F., Hamker, F.H. (2012). Comparison of GPU- and CPU-implementations of mean-firing rate neural networks on parallel hardware. Network: Computation in Neural Systems, 23(4): 212-236. PDF-document

Dinkelbach, H.Ü., Vitay, J., Hamker, F.H. (2019). Scalable simulation of rate-coded and spiking neural networks on shared memory systems. Conference on Cognitive Computational Neuroscience. 13-16 September 2019, Berlin, Germany. doi:10.32470/CCN.2019.1109-0