Leabra


Leabra stands for local, error-driven and associative, biologically realistic algorithm. It is a model of learning which is a balance between Hebbian and error-driven learning with other network-derived characteristics. This model is used to mathematically predict outcomes based on inputs and previous learning influences. This model is heavily influenced by and contributes to neural network designs and models. This algorithm is the default algorithm in emergent when making a new project, and is extensively used in various simulations.
Hebbian learning is performed using conditional principal components analysis algorithm with correction factor for sparse expected activity levels.
Error-driven learning is performed using GeneRec, which is a generalization of the recirculation algorithm, and approximates Almeida–Pineda recurrent backpropagation. The symmetric, midpoint version of GeneRec is used, which is equivalent to the contrastive Hebbian learning algorithm. See O'Reilly for more details.
The activation function is a point-neuron approximation with both discrete spiking and continuous rate-code output.
Layer or unit-group level inhibition can be computed directly using a k-winners-take-all function, producing sparse distributed representations.
The net input is computed as an average, not a sum, over connections, based on normalized, sigmoidally transformed weight values, which are subject to scaling on a connection-group level to alter relative contributions. Automatic scaling is performed to compensate for differences in expected activity level in the different projections.
Documentation about this algorithm can be found in the book "Computational Explorations in Cognitive Neuroscience: Understanding the Mind by Simulating the Brain" published by MIT press. and in the

Overview of the leabra algorithm

The pseudocode for Leabra is given here, showing exactly how the pieces of the algorithm described in more detail in the subsequent sections fit together.
Iterate over minus and plus phases of settling for each event.
o At start of settling, for all units:
- Initialize all state variables.
- Apply external patterns.
- Compute net input scaling terms.
- Optimization: compute net input once from all static activations
.
o During each cycle of settling, for all non-clamped units:
- Compute excitatory netinput
-- sender-based optimization by ignoring inactives.
- Compute kWTA inhibition for each layer, based on g_i^Q:
* Sort units into two groups based on g_i^Q: top k and
remaining k+1 -> n.
* If basic, find k and k+1th highest
If avg-based, compute avg of 1 -> k & k+1 -> n.
* Set inhibitory conductance g_i from g^Q_k and g^Q_k+1
- Compute point-neuron activation combining excitatory input and
inhibition
o After settling, for all units, record final settling activations
as either minus or plus phase.
After both phases update the weights, for all connections:
o Compute error-driven weight changes with CHL with soft weight bounding
o Compute Hebbian weight changes with CPCA from plus-phase activations
o Compute net weight change as weighted sum of error-driven and Hebbian
o Increment the weights according to net weight change.

Implementations

is the original implementation of Leabra, written in C++ and highly optimized. This is the fastest implementation, suitable for constructing large networks. Although emergent has a graphical user interface, it is very complex and has a steep learning curve.
If you want to understand the algorithm in detail, it will be easier to read non-optimzed code. For this purpose, check out the . There is also an available, that can be easily installed via install.packages in R and has a to how the package is used. The MATLAB and R versions are not suited for constructing very large networks, but they can be installed quickly and are easy to use. Furthermore, they can also be adapted easily.

Special algorithms