Each neuron is a leaky integrate-and-fire (LIF) unit: its membrane potential leaks toward zero and jumps up whenever a weighted spike arrives from an upstream neuron. When the potential crosses threshold, the neuron fires, resets, and sends a spike packet — visualized as a moving particle — down every outgoing synapse.
Synapses strengthen or weaken using a trace-based Hebbian rule, a simplified continuous analogue of spike-timing-dependent plasticity (STDP) found in real cortical synapses: connections between neurons that fire together are potentiated, while uncorrelated or idle synapses decay.
LIF neuron:
dV/dt = -V/τ + I(t)
fire & reset V→0 when V ≥ V_th
Hebbian trace plasticity:
dw_ij/dt = η · ( x_i · x_j − λ · w_ij )
x_i = spike trace of neuron i (jumps to 1 on
spike, decays with time constant τ_x)
- Input firing rate — Poisson spike rate driving the 6 input neurons (left layer).
- Learning rate (η) — how fast correlated firing potentiates synaptic weight w.
- Membrane noise — random fluctuation added to hidden/output potentials, mimicking biological channel noise.
- Plasticity toggle — freezes/unfreezes weight updates so you can compare a static vs. learning network.
- Reset synapses — reinitializes all weights to a random baseline.
This trace-Hebb / STDP mechanism is the biological inspiration behind neuromorphic chips (e.g. Intel Loihi) and spiking-network research aimed at building energy-efficient, brain-like learning systems — a core thread in biological AI (BAI).