Neural network simulator being developed as part of my PhD.
Alternatives To Bain
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Pytorch67,69014611 hours ago23August 10, 202212,233otherPython
Tensors and Dynamic neural networks in Python with strong GPU acceleration
Tensorflow Examples42,312
8 months ago218otherJupyter Notebook
TensorFlow Tutorial and Examples for Beginners (support TF v1 & v2)
Pytorch Tutorial26,129
2 months ago85mitPython
PyTorch Tutorial for Deep Learning Researchers
22 days ago1,956otherC
Convolutional Neural Networks
Awesome Tensorflow16,809
5 months ago30cc0-1.0
TensorFlow - A curated list of dedicated resources
18 days ago10apache-2.0Lua
Face recognition with deep neural networks.
3 years ago22
Papers with code. Sorted by stars. Updated weekly.
a year ago53HTML吴恩达老师的深度学习课程笔记及资源)
Neural Networks And Deep Learning14,073
4 months ago8Python
Code samples for my book "Neural Networks and Deep Learning"
5 months ago10
Must-read papers on graph neural networks (GNN)
Alternatives To Bain
Select To Compare

Alternative Project Comparisons

Bain - a neural network simulator

The Bain neural network simulator is designed to meet the following requirements:

  • Simulate neural networks at a level of fidelity, with respect to natural neural networks, greater than typical rate-based models used in computer science but lower than biophysical models used in neuroscience.
  • Provide a framework to allow easily plugging in parameterised functional/ computational models for neurons, synapses and neuromodulators (neuromodulator functionality coming soon). The framework is designed for spiking neuron models and plastic synapses, but can also be used for rate-based and fixed-weight models.
  • Support arbitrary topologies.
  • Simulate small to large neural networks (tens of neurons/synapses to millions of neurons/synapses), efficiently and with high performance.
  • Make use of SIMD hardware (eg GPUs) for large networks via OpenCL and Aparapi.
  • Be written in Java.

Aparapi allows writing Java code that follows certain conventions and restrictions that it will then turn into OpenCL at run-time. If no OpenCL compatible platforms are available then Aparapi falls back to using a Java Thread Pool or regular sequential operation automatically. Thus to add a new model of a neural network component, one only need extend the appropriate base class and implement a few methods, without thinking (very much) about OpenCL, thread pools, etcetera.

The latest version is available at, and issues should be posted at, OliverColeman/bain

NOTE: unfortunately limitations in Aparapi severely restrict the efficiency of SIMD computations. At present Aparapi does not allow communication between kernels (for example the neuron and synapse kernels), thus the output of all neurons and all synapses must be transferred from the GPU to the CPU and back again so they can be input into the synapses and neurons respectively for the next cycle, mostly negating any performance improvements.


Bain requires Java 7 or greater. Bain is built with gradle. To build a runnable JAR file, run the following command from the project directory (it is not necessary to install gradle):

./gradlew withDeps

on *nix systems, or

gradlew withDeps

on Windows systems. This will create a runnable jar file in build/libs. If you want a jar file that does not include the dependencies replace "withDeps" with "assemble".




  • jfreechart (>= 1.0.19)
  • swingx (>= 1.6.4)

Getting started

You can run the GUI by running

java -jar bain[-all]-<version>.jar

Read the API documentation starting with com.ojcoleman.bain.Simulation, and the references within. API documentation is available at


This library is being written as part of my PhD: "Evolving plastic neural networks for online learning". For more details see

"Using all this knowledge as a key, we may possibly unlock the secrets of the anatomical structure; we may compel the cells and fibres to disclose their meaning and purpose." Alexander Bain (who first proposed that thoughts and body activity resulted from interactions among neurons within the brain), 1873, Mind and Body: The Theories of Their Relation, New York: D. Appleton and Company. Also, "Bain" is just one letter away from "Brain"... ;)


Bain is licensed under the GNU General Public License v3. A copy of the license is included in the distribution. Please note that Bain is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Please refer to the license for details.

Popular Network Projects
Popular Neural Projects
Popular Networking Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.