Brian
Brian is a simulator for spiking neural networks available on almost all platforms. This is the legacy version that is no longer developed, for new projects consider using Brian2 instead.
Install / Use
/learn @brian-team/BrianREADME
-
Brian 1.x is deprecated, please use Brian2 instead: * -
https://github.com/brian-team/brian2 *
Brian 1 depends on Python 2.x, so running it on modern systems has become
more difficult. For convenience, we provide a Docker image that you can use
to run existing Brian 1 code. It is based on a Debian image, and provides
Brian 1.4.3, as packaged by the NeuroDebian team (https://neuro.debian.net/).
To use these images, you either need to have docker (https://docker.com),
podman (https://podman.io/) or singularity (https://sylabs.io/singularity/)
installed – the commands below are shown for the docker command, but you can
simply replace them by podman if necessary. For singularity, the basic workflow
is similar but the commands are slightly different, please see the documentation.
To pull the container image with singularity, refer to
docker://briansimulator/brian1.4.3.
Running a graphical interface within the docker container can be complicated,
and the details how to make it work depend on the host operating system.
We therefore recommend to instead either 1) only use the container image to
generate and save the simulation results to disk, and then to create the plots
on the host system, or 2) to use the container image to plot files to disk by
adding plt.savefig(...) to the script. The container already sets the
matplotlib backend to Agg by default (by setting the environment variable
MPLBACKEND), necessary to avoid errors when no graphical interface is
available.
To download the image and to rename it to brian1 (for convenience only, the commands below would also work directly with the full name), use:
docker pull docker.io/briansimulator/brian1.4.3
docker tag briansimulator/brian1.4.3 brian1
The following command runs myscript.py with the container image providing
Brian 1 and its dependencies, mapping the current directory to the working
directory in the container (this means, the script has access to all files in
the current directory and its subdirectories, and can also write files there):
docker run -v "$(pwd):/workdir" brian1 python myscript.py
For Windows users using the Command Prompt (cmd.exe) instead of the Powershell, the following command will do the same thing:
docker run -v %cd%:/workdir brian1 python myscript.py
To run an interactive ipython prompt, use:
docker run -it -v "$(pwd):/workdir" brian1 ipython
Depending on your operating system, files written by the container might be owned by the user "root", which can lead to problems later (e.g. you cannot rename/move/delete/overwrite the file on your home system without administrator rights). On Unix-based systems, you can prevent this issue by running scripts with the same user id as the host user:
docker run -u $(id -u):$(id -g) -v "$(pwd):/workdir" brian1 python myscript.py
Please report any issues to the Brian discussion forum: https://brian.discourse.group
Original README file for Brian 1 follows :
============ B R I A N ============================= A clock-driven simulator for spiking neural networks
Version: 1.4.4 Authors: Romain Brette http://romainbrette.fr Dan Goodman http://neural-reckoning.org Team: Cyrille Rossant http://cyrille.rossant.net/ Bertrand Fontaine Victor Benichoux Marcel Stimberg Jonathan Laudanski
==== Installation ==========================================================
Requirements: Python (version 2.5-7), the following modules:
- numpy (version >=1.4.1)
- scipy (version >= 0.7)
- matplotlib (version >=0.90.1, optional, necessary for plotting )
- sympy (optional, necessary for the "event-based" feature in Synapses)
All operating systems: run 'python setup.py install' from the download folder.
Windows: You can run the installer exe file.
==== Extras ================================================================
Included in the extras download are:
docs Documentation for Brian including tutorials.
examples Examples of using Brian, these serve as supplementary documentation.
tutorials Fully worked through tutorials on using Brian. These can be read through in the documentation too.
==== Usage and Documentation ===============================================
See the documentation in the extras download, or online:
http://www.briansimulator.org/docs
==== Changes ===============================================================
Version 1.4.3 to 1.4.4
A minor bugfix release to fix incompatibilities with recent numpy versions (>= 1.13), and to prepare for the removal of deprecated sympy features. Also fixes a potential matplotlib issue with realtime plotting (contributed by Pedro Machado)
Version 1.4.2 to 1.4.3
A minor bugfix release to fix incompatibilities with the upcoming numpy
release. Also prepares for the removal of the scipy.weave package (replaced
by the weave package).
Version 1.4.1 to 1.4.2
This is a bugfix release that does not add any major features. See the commit log at http://neuralensemble.org/trac/brian/log/ for details. Note that our development efforts are now entirely focused on Brian 2 (https://github.com/brian-team/brian2), this will most likely be the last release in the 1.x series.
Version 1.4.0 to 1.4.1
Major features:
- C extensions are compiled by default during installation (with a fallback to the Python version if compilation fails) -- this might lead to a considerable speedup for users who did not compile those extensions manually before
Minor features:
- Convenience methods for the Synapses class, allowing to save and load the connectivity and to convert the weights into a matrix
- A new openmp option to switch on the use of OpenMP pragmas in generated C code
- Brian hears: Two new models, MiddleEar (filtering by the middle ear) and ZhangSynapse (model of the IHC-AN synapse)
- Brian hears: New convenience functions to get reasonable axis ticks for logarithmic axes
Improvements:
- Brian's documentation is now also available under brian.readthedocs.org
- ProgressReporter has context manager support (i.e. can be used in "with" statements)
- NeuronGroup and Synapses work with empty model specifications.
- C version of SpikeContainer is now picklable
Bug fixes:
-
Synaptic equations referring to variables in the pre- or postsynaptic group are never considered as being linear (fixes ticket #83)
-
Fix issue with static equations in synaptic models (see https://groups.google.com/d/msg/briansupport/-/uqxLK_yoqKUJ )
-
Make LinearStateUpdater pickable, even if array B is "NotImplemented".
-
Fixed the bug in which the StateSpikeMonitor didn't record variables defined with a static equation.
-
Important bug fixes for brian hears, all users are encouraged to update:
- Make sure that LinearFilterbank copies it source and therefore not changes it (when not using weave) (fixes ticket #73)
- Fix some bugs in the TanCarney model
- Fix shifting multi-channel sounds with fractional=True (fixes ticket #80)
Experimental features:
- A C version of SpikeQueue (used in the Synapses class), which can lead to a considerable speedup (see "Advanced concepts/Compiled code" for instructions how to use it).
- Delays can be specified as a parameters of the Synapses model and then be changed dynamically.
Version 1.3.1 to 1.4.0
Major features:
- New Synapses class (plasticity, gap junctions, nonlinear synapses, etc)
Minor features:
- New AERSpikeMonitor class
- Several updates to library.electrophysiology
Improvements:
- Units should work better with static code analysers now
- Added Network.remove
- SpikeMonitor has a new .it attribute (returns pair i, t of arrays of spike times)
- Many new examples
Bug fixes:
- Assigning to a static variable (equation) now raise an error
- Fixed issues for TimedArrays with explicitly set times (fixes ticket #81)
- Fixed bug, repr and str didn't work for Sound
- Fixed bug where tone(array_of_frequencies, ...)
- Fixed SparseConnectionMatrix bug suggested by Owen Mackwood
- Fixed bug in Parameters reported by Jimmy Bonaiuto
- Fixed bug with contained_objects reported by Oleg Sinyavskiy
- Units repr and str fixes
- Sound.spectrum, Sound.pinknoise, brownnoise
- t wasn't available in StringReset and PythonThreshold
Deprecated or removed features:
- MultipleSpikeGeneratorGroup
- experimental.coincidence_detection
Experimental features:
- Generating model documentation automatically (experimental.model_documentation)
Version 1.3.0 to 1.3.1
Minor features:
- New PoissonInput class
- New auditory model: TanCarney (brian.hears)
- Many more examples from papers
- New electrode compensation module (in library.electrophysiology)
- New trace analysis module (in library.electrophysiology)
- Added new brian.tools.taskfarm.run_tasks function to use multiple CPUs to perform multiple runs of a simulation and save results to a DataManager, with an optional GUI interface.
- Added FractionalDelay filterbank to brian.hears, fractional itds to HeadlessDatabase and fractional shifts to Sound.shifted.
- Added vowel function to brian.hears for creating artificial vowel sounds
- New spike_triggered_average function
- Added maxlevel and atmaxlevel to Sound
- New IRNS/IRNO noise functions
Improvements:
- SpikeGeneratorGroup is much faster.
- Added RemoteControlClient.set(var, name) to allow sending dat
