Echo State Melody Lab

Train a reservoir computer to play a melody back from memory. You don't train the network — you tune it, and a linear readout is solved in closed form.

Target melody

Network settings

Score

Free-run match
Steps survived
Teacher-forced
Measured ρ(W)
Readout dim
Solve time

Piano roll — target vs. free-running network

target network, correct network, wrong priming (fed real notes)

Brain view — the reservoir firing, one step at a time

excited (+) inhibited (−) synapse carrying strong signal now receives the note input
The silhouette is decorative. A reservoir has no spatial organisation — neurons are scattered to fill the shape, and a synapse crossing the middle is no different from a short one. What is real: every dot is an actual neuron, its colour is that neuron's activation at this step, and the lit synapses are genuine large weights in W currently carrying signal.

Reservoir state — nodes × time (free-run)

+1 0 −1 each row is one neuron; a healthy reservoir shows rich, non-repeating texture that still locks to the melody's period

Error

teacher-forced RMSE per step free-run mistakes cumulative free-run error rate

Run history — click a row to reload those settings

MelodyFreeSurvNρleak inconnridgetemprepsseed
no runs yet
How this works & what to tune

An echo state network is a big pool of randomly wired neurons whose recurrent weights are never trained. The melody is fed in one grid step at a time; the pool's activations become a high-dimensional, fading-memory encoding of everything heard recently. The only thing fitted is a linear map from the state to the next note — solved in one shot by ridge regression (W = (XXᵀ + λI)⁻¹ XYᵀ), no gradient descent.

Spectral radius ρ sets memory length. Below ~0.5 the reservoir forgets too fast to know where it is in the tune; above ~1.4 it drifts toward chaos and the loop destabilizes. Melodies with repeated sections need more memory to tell one repeat from the next.

Leak rate is the state's update speed. Low leak smooths over many steps — useful for slow signals, but here it blurs adjacent notes and scores badly.

Nodes raise capacity: more neurons, more linearly separable states, but also more parameters to regularize and slower solves.

Ridge λ trades memorization for stability. Too small and the readout amplifies noise once the loop is closed; too large and it collapses to predicting the most common token.

Free-run match is the real score: the network is primed on real notes, then fed only its own output for two full choruses. Teacher-forced accuracy is much easier and can look perfect while free-running fails completely.