Neural Gas Playground

⌨️ Shortcuts Space play/pause T step I initialize D random data S random seed A run all

Prototype Graph

data active edges prototypes top-ranked winners current sample

Training Metrics

i

Prototype Distance Histogram

i

Notes

Neural Gas

Each update begins with one sampled datapoint. Neural gas ranks every prototype by distance to that sample, nudges the whole set toward it with rank-weighted strength, and refreshes the edge between the two closest prototypes.

Scoring Systems

The original paper uses an exponential neighborhood, so the update strength decays as exp(-rank / lambda). The modified variant in this app uses a stronger inverse-square decay, which concentrates motion more aggressively on the closest ranks.

w i n e w = w i o l d + ϵ ( 1 k i 2 ) ( v w i o l d )
Using The App

Choose a dataset, tune the algorithm controls, then initialize and either step, play, or run the full trajectory. Use the scrubber to inspect any recorded state.

Data-generation controls rebuild the sampled cloud. Algorithm controls change the neural gas update itself. After changing either set, use Initialize to start a fresh run.

Original reference: A “Neural-Gas” Network Learns Topologies, Martinetz, T. and Schulten, K., 1991, in Artificial Neural Networks, Elsevier.