1.4. Changelog


  • The tensorboard extension allows to log various infos and visualize them using tensorboard.
  • The API of the convolution extension has slightly changed, check the documentation.
  • Changed default behavior from the built-in Izhikevich neuron model from fast spiking to regular spiking.
  • PopulationView.rank_from_coordinates and PopulationView.coordinates_from_rank now accept coordinates relative to the geometry of the popview using the local flag.
  • Fixed installation on Anaconda distributions. Now works in colab with !pip install ANNarchy.
  • Several bug fixes (variable-dependent refractory periods, conditionals of the type “if (t==1)”, SpikeSourceArray, etc).
  • Improved performance with CUDA.

  • MacOS compatibility.
  • Bugfix on Projection.load().


  • SpikeSourceArray can now receive connections (which will be ignored, but may be used to investigate plasticity mechanisms).
  • Added a clear_all_callbacks() method when using @every.
  • Added a CurrentInjection population allowing to connect a rate-coded population to the conductance of a spiking population.
  • Several bug fixes and improvements.


  • Feature: delays can now be changed after compile(), even if the maximum delay is higher than before.
  • Improved performance for spiking networks with variable delays through the use of ring buffers.
  • Improved control of single/double precision.
  • Improved performance on GPUs.
  • Fixed bug when SpikeSourceArray, TimedArray and HomogeneousCorrelatedSpikeTrains were used inside a network or parallel_run().
  • Fixed bug when using different seeds in parallel_run().
  • Global functions defined by add_function() were not available on CUDA devices.
  • The use of dendrite.rank is deprecated, use dendrite.pre_ranks instead.
  • GPU hardware detection has been improved.


  • Issue #55: Populations and projections can now save/load their variables into/from Numpy .npz files instead of pickled binary text files.
  • Bugfix (CUDA): modified transmission flag was ignored on projections.
  • Bugfix: memory leak when using Monitors in parallel_run().
  • Added raster_plot, histogram and so on outside the monitor for offline analysis.
  • Improvements on memory management.


  • Monitor: added new argument period_offset to define the offset within a period to record. The default argument is 0ms to match the previous behavior (at the beginning of the period).
  • Issue 54: when generating a report, possible subfolders are created before writing the report file
  • CUDA now supports usage of post.sum() respectively pre.sum() in synaptic equations.
  • CUDA SpikeSourceArray: wrong update of events on the GPU device led to wrong results.
  • Various bug fixes and improvements.


  • Merged pull request by @ilysym to improve OpenMP efficiency. Thanks Ilya!
  • Added a power(x,a) function to replace the slow cmath pow(x,a) function
  • Added accessors to ANNarchy.core.Network to allow access to all populations/projections assigned to a Network
  • Various bug fixes and improvements.


  • pre_spike and post_spike fields of a spiking neuron can now modify pre and post synaptic variables:

    pre_spike = """
        g_target += w
        post.nb_spikes += 1
  • SpikeSourceArray available on CUDA.

  • Monitor.mean_fr() and Monitor.histogram() now work with PopulationViews (thanks @ilysym).

  • Many bug fixes with Python3 and CUDA.


  • Rate-coded neurons can now use sum() to sum over all targets, instead of specifying them.
  • Constant objects can now be created to define global-level parameters which do not need to be explicitly defined in Neurons/Synapses.
  • Parameter definitions can use constants. Note that changing the constant after compilation does not change the parameter.
  • The initial value of a variable (init=) can use constants instead of numerical values.
  • report() has been improved and can now generate Markdown reports, which can be converted to html or pdf by pandoc.


  • Issue 44: The performance of spiking networks with CUDA has been improved.
  • Population.compute_firing_rate can now be called anytime to change the window over which the mean firing rate of a spiking neuron is computed.
  • The performance of the exponential numerical method has been improved by computing the step size outside the loop (when possible).
  • Mean-firing rate computation is now available for CUDA devices (slow!).
  • Issue 43: the path to the CUDA installation can now be set in a config file at ~/.config/ANNarchy/annarchy.json.
  • Simulations on GPU can be started on the command line by using --gpu or --gpu=2 if you have multiple GPUs.


  • CUDA implementation for rate-code networks revised and fixed several errors.

  • CUDA now supports now the simulation of spiking neurons (please refer to the documentation to discover limitations).

  • CUDA allows now the monitoring of dendrites.

  • Added the command line argument –cuda to run simulations on CUDA devices.

  • Issue 38: user-defined functions are now available in user space:

    add_function('sigmoid(x) = 1.0 / (1.0 + exp(-x))')
    x = np.linspace(-10., 10., 1000)
    y = functions('sigmoid')(x)
  • Major reimplementation of data structures for the connectivity patterns (LIL, CSR).

  • Added the TimedArray population to store the temporal evolution of a population’s firing rate internally. See Setting inputs.

  • Fixed structural plasticity and added an example in examples/structural_plasticity.

  • Added the projection keyword allowing to declare a single parameter/variable for the whole projection, instead of one value per synapse (the default) or one value per post-synaptic neuron (keyword postsynaptic).

  • Parameters can now also be recorded by Monitors.

  • Projections can now be monitored, if the user knows what he does…

  • The global parameters of populations and projections can now be saved/loaded to/from a JSON file for manual parameterization.

  • Many bug fixes.

  • Deprecated recording functions and objects such as RateNeuron are removed.


  • Sympy 1.0 introduced a regression to the != operator.
  • Issue 30: PopulationViews had a bug hen modifying variables on a multidimensional population.
  • Issue 33: connect_one_to_one now accepts any kind of popview (even with random indices), as long as they have the same size.
  • Issue 33: recording spikes on popviews did not work correctly.
  • The normal distribution is fixed in CUDA.
  • Delays are now rounded to the next multiple of dt, not cast into a int (i.e. 1.99 is now 2, not 1 with dt=1.0).
  • SpikeSourceArray is now tolerant to very high firing schedules.


  • Spiking networks can now use variable delays, at the cost of extra computations.

  • Fixed bug in parser when a synapse uses pre/post variables with one name containing the other (e.g. r and r_mean).

  • Fixed bug when assigning postsynptic variable a random distribution.

  • Added the ability to access the weighted sums of a rate-coded population with:

  • Added the ability to record these weighted sums:

    m = monitor(pop, ['r', 'sum(exc)'])


  • Fixed bug when loading a network saved before 4.5.3.

  • Added the every decorator allowing functions to be called periodically during a simulation:

    result = []
    def set inputs(n):
        # Set inputs to the network
        pop.I = Uniform(0.0, 1.0)
        # Save the output of the previous step
    simulate(100 * 1000.)
  • Fixed installation with non-standard Python distribution (e.g. Anaconda).

  • Added a HomogeneousCorrelatedSpikeTrains class allowing to generate homogeneous correlated spike trains:

    pop = HomogeneousCorrelatedSpikeTrains(geometry=200, rates=10., corr=0.3, tau=10.)
  • Installing through pip does not forget CUDA files anymore.

  • Added Population.clear() to clear all spiking events (also delayed) without resetting the network.

  • Population.reset() and Projection.reset() now accept a list of attributes to be reset, instead of resetting all of them.

  • Unit tests are now performed on Travis CI to get a badge.

  • Bug fixed: min/max bounds on g_target was wrongly analyzed when depending on a parameter.

  • parallel_run() now accepts additional arbitrary arguments that can be passed to the simulation callback.

  • Added an ite(cond, statement1, statement2) conditional function replicating if cond: statement1 else: statement2, but which can be combined:

    r = 1.0 + ite(sum(exc) > 1.0, sum(exc), 0.0) + ite(sum(inh) > 1.0, -sum(inh), 0.0)
  • The Network class has several bugs fixed (e.g. disabled populations stay disabled when put in a network).

  • Populations have now an “enabled” attribute to read their status.


  • Spiking neurons now define the variable t_last storing the time (in ms) of the last emitted spike.
  • Added a method compute_firing_rate() that allows spiking neurons to compute their mean firing rate over a prefined window and store the result (in Hz) into the reserved variable r.
  • Fixed bug when using “if a == b”.
  • Pre- and post-synaptic occuring at the same time are now both evaluated. The flag unless_post can be set in pre_spike to disable the evaluation of the pre-spike in that case (default behavior for simple_stdp example).
  • Fixed code generation for MacOS X, especially when using a non-standard Python installation (e.g. anaconda).
  • compile() now accepts a different compiler (g++ or clang++) and custom flags.
  • Now works correctly in ipython notebooks.
  • Added iPython notebooks to the examples.
  • Fixed the load() method when using a single weight, or for very sparse random projections.


  • Projections can be assigned a name.

  • A list or Numpy array can be used to slice a Population:

    neurons = [1, 4, 17, 34]
    subpop = pop[neurons]
  • Synapses can be accessed directly at the Projection level with:

    proj.synapse(pre, post) # equivalent to proj[post][pre]
  • Bugfix: pop[0] now returns a PopulationView containing the neuron 0, not an IndividualNeuron (accessible through pop.neuron(0))

  • Various bugfixes in CUDA.

  • Bugfix: connect_from_sparse now works with popviews whose ranks are not linearly increasing (e.g. columns)

  • Bugfix: IO access to projection data should now be much faster.

  • Spiking neurons can have delayed variables.


  • Fixed save/load methods
  • parallel_run() has now control over the seeds.
  • report(): fixed nested conditionals and power functions
  • Synaptic transmission can be stopped using proj.transmission = False
  • Synaptic update can be disabled using proj.update = False
  • Synaptic plasticity can be disabled using proj.plasticity = False
  • enable_learning() accepts period and offset arguments.


  • Fixed compilation on MacOSX
  • Fixed compatibility with Python 3.4
  • Refactoring of the generation templates
  • Fixed bug introduced by Sympy 0.7.6
  • Multiple blocks of ODEs and assignments can now be used in the equations field.
  • Parser simplified
  • Dense all-to-all connectivity matrices use indices instead of vectors, improves performance.
  • Projections initialized with a single weight value and without plasticity now use a double for the weight instead of vector<vector<double>>
  • Regression on get_record(reshape=True) fixed.
  • CUDA backend improved.
  • parallel_run() now uses the minimum between the number of available cores and the total number of networks.
  • Several bugs in report.


  • A Network object has been added to run multiple simulations in parallel (parallel_run()). See Parallel simulations and networks.
  • Recording goes through the Monitor object. Old recording methods are depreciated. See Recording with Monitors.
  • The flag exact is replaced by event-driven. Still works, but will be suppressed in future versions.
  • The behavior of a spiking neuron with two coupled variables (e.g. Izhikevich) during the refractory period is changed. The ODEs are not evaluated at all during the refractory period (except the conductances). The unless-refractory flag has no effect anymore. Before, u started decaying during the refractory period.
  • Variables updated in pre-spike or post-spike (spiking synapse) can now define min/max bounds. Useful to avoid clipping explicitly the weights.
  • Change in hybrid populations. PoissonPopulation should be used for rate-to-spike conversion, DecodingProjection for spike-to-rate. See Hybrid networks.
  • Bug when using conditionals in pre-spike and post-spike.
  • Bug when using t_pre and t_post explicitly.
  • Speed-up of connect_fixed_number_pre/post.


  • Experimental support for CUDA backend for rate-coded networks.
  • Any pre-synaptic variable can be delayed if used in the synapse.
  • g_target can define min/max flags.
  • Support for MacOS X.
  • Parallel performance for OpenMP and spiking networks improved.
  • Sequential code (1T) does not use OMP.
  • psp argument can use global operations and global variables.
  • Added connect_from_sparse() method.


  • Small bug fixes.


  • Automatic reporting is added.
  • Several bug fixes.
  • The distinction between Rate- and SpikeNeuron objects is deprecated, use Neuron instead.
  • The distinction between Rate- and SpikeSynapse objects is deprecated, use Synapse instead.


  • Structural plasticity can be defined at the synaptic level.


  • Random distributions are available in synapses.
  • Populations can be momentarily disabled/enabled.
  • Recording can be done with a given period instead of every time step.
  • Different modes for Spike2Rate conversion.
  • Extension for shared projections (convolution/pooling) improved.


  • CUDA implementation for rate-coded networks with small restrictions.
  • Weight-sharing for convolutions and pooling.
  • Possibility to create projections using a dense connection matrix or data saved in a file.
  • A seed can be defined for the random number generators.


  • Simplified internal structure for the generated code.
  • Major speed-up for compilation and execution times.
  • Rate-coded projections can perform other functions than sum (min/max/mean) over the connected synapses.


  • Neuron and Synapse replace RateNeuron, SpikeNeuron, RateSynapse, SpikeSynapse in the main interface (kept for backward compatibility).
  • Default PyNN neural models are now available (Izhikevich, IF_curr_exp, IF_cond_exp, IF_curr_alpha, IF_cond_alpha, HH_cond_exp, EIF_cond_alpha_isfa_ista, EIF_cond_exp_isfa_ista).
  • Bug fixes for delays and spike propagation.
  • Connectivity matrices (CSR) are more efficient.
  • Several PyNN examples are added to the examples/ folder.


  • Spike conditions can depend on several variables.
  • The midpoint numerical method is added.
  • Ability to choose globally the numerical method.


  • The Euler implicit method is added.
  • Systems of equations are now solved concurrentely.


  • Early-stopping of simulations (simulate_until).


  • Added hybrid populations (Spike2RatePopulaton, Rate2SpikePopulation).
  • Individual save/load of populations and projections.
  • PopulationViews can be used to build Projections.
  • CSR objects are simplified.
  • Default conductance behaviour (g_target = 0.0).
  • Random distribution objects can take global parameters as arguments.
  • min and max bounds can depend on other variables.
  • Logical operators (and, or..) can be used in conditions.


  • Rate-coded neurons must output “r”, not “rate”. Synapses must use “w”, not “value”.
  • Synapses can access pre-synaptic weighted sums (pre.sum(exc)).
  • Created PoissonPopulation.


  • Connectivity matrices are now created in Cython.
  • Recording methods have changed.
  • Spiking neurons have a refractory period.
  • Added clip() functions for semi-linear transfer functions.
  • Added smoothed_firing_rate() method for visualizing spiking networks.


  • First stable release with both rate-coded and spiking networks.