AI & ML Atlas
Neural NetworksalgorithmInteractive simulation
Competitive Learning
Neurons compete for each input and only the winner learns.
The idea
Each output neuron holds a weight vector. For an input, the neuron whose weights are closest wins, and only its weights move toward the input. Over time each neuron becomes the prototype of a cluster of similar inputs, much like online k-means.
w_winner ← w_winner + η (x − w_winner)
Watch it run
This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.
- unit
- winner
- current sample
Four competing units start in the middle. Grey dots are the data.
- step:
- 0
- avg distance to nearest unit:
- 0.256
1/67
Competitive learning: winner-takes-all, like an online version of k-means.
Step by step
- 1Initialise the neurons' weight vectors.
- 2Present an input.
- 3Find the winning neuron (closest weights).
- 4Move the winner's weights a little toward the input.
- 5Repeat over the data.
Where it is used
Clustering and vector quantisation.
Watch out for
Neurons that never win ("dead units") never learn; careful initialisation is needed.