Skip to content
StackDecode
AI & ML Atlas
Neural NetworksarchitectureInteractive simulation

Self-Organising Maps (SOM)

A grid of neurons that arranges itself into a 2-D map of the data.

The idea

Neurons sit on a grid and each holds a weight vector. For an input, the best-matching unit and its grid neighbours are pulled toward the input; the neighbourhood shrinks over time. Nearby neurons end up representing similar data, so the grid becomes a topology-preserving picture of the data.

wᵢ ← wᵢ + η·h(i, bmu)·(x − wᵢ)

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

A 5×5 grid of units starts bunched in the middle. Grey dots are the data. The grid lines show which units are neighbours.

step:
0
avg distance to nearest unit:
0.158
1/67

A self-organising map keeps its grid shape while stretching to cover the data.

Step by step

  1. 1Initialise a grid of weight vectors.
  2. 2Pick an input and find the best-matching neuron.
  3. 3Pull that neuron and its grid neighbours toward the input, with strength falling with grid distance.
  4. 4Shrink the learning rate and neighbourhood radius.
  5. 5Repeat over many inputs.

Where it is used

Visualising high-dimensional data, clustering, colour quantisation.

Watch out for

Needs the grid size and decay schedule tuned; maps are not unique.

Related