esnfed playground

Everything here runs live in your browser — a tiny Echo State Network (reservoir + ridge readout) implemented in plain JavaScript, with no libraries and no server. Drag the sliders, orbit the 3D views, press play.  ← back to the docs

1 · Reservoir activations 3D how it reacts to input

Each dot is a reservoir neuron and the lines are its connections; colour is the activation as the input drives the network, and node size grows with degree (so scale-free hubs stand out). Switch the structure (ring, chain, lattice, small-world, scale-free, modular, star or random) and the input to see how connectivity and drive shape the dynamics. The right panel shows the activation of each neuron over time — one coloured trace per neuron, scrolling as the reservoir responds to the input. A higher spectral radius lengthens the memory. Pick a structure and input, then press play.

drag to orbit · scroll to zoom

2 · State space 3D the echo state property, made visible

The reservoir has one dimension per neuron, so its state is impossible to look at directly. Here it is projected onto its three strongest principal components — a faithful 3D shadow of the real trajectory. Two networks are driven with the same input from different starting states: one from rest, one from a random state. With ρ < 1 the two curves collapse onto each other and the network forgets where it started — that is the echo state property, and it is what makes the readout trainable. Push ρ past 1 and they never meet: the reservoir keeps a permanent memory of its initial condition and the task becomes unlearnable.

drag to orbit · scroll to zoom
separation
echo state property
variance kept by 3 PCs
Press play. Watch the two ribbons.

3 · Chaos: predicting the Lorenz attractor 3D free-running

The reservoir is trained for one step-ahead prediction of the Lorenz system, then cut loose: its own output is fed back as its next input, so it runs with no further access to the truth. A good reservoir does not merely track the trajectory — it reproduces the shape of the attractor, both wings and all. Because the system is chaotic, the two paths must eventually separate; the interesting quantity is how long they stay together, and whether the prediction still looks like a Lorenz butterfly long after it has stopped matching point for point.

drag to orbit · scroll to zoom
train NRMSE
steps tracked
free-run step
attractor kept
true Lorenz reservoir, free-running

4 · The hyper-parameter landscape 3D why ρ ≈ 1 wins

Every point on this surface is a fully trained reservoir — the grid is swept live, one network per cell, and the height is the resulting test error. It shows the shape of the problem rather than a single tuned number: a broad low valley near the edge of stability, a wall where the dynamics stop echoing, and the interaction between the spectral radius and the leaking rate that makes them impossible to tune independently. Lower is better; the marker is the best cell found.

drag to orbit · scroll to zoom
best NRMSE
at ρ
at leak a
networks trained0

5 · Central vs Federated vs Local vs Ensemble the strategies

A forecasting task — pick synthetic, the real TED spread (a credit-risk series, 1986–2022) or chaotic Mackey-Glass — split across clients. Federated ridge pools the clients' summary statistics and lands exactly on centralized; local-only models degrade as each client is starved of data; the ensemble of heterogeneous reservoirs sits in between. Left: the animated test-set forecast; right: test NRMSE (lower is better).

centralized federated (= centralized) local-only (mean) ensemble target

6 · Differential privacy what privacy costs

Exact federated ridge already keeps raw data on the device — clients send only the summed statistics A and B. Those second moments still leak information about individual records, so each client can clip its contribution and add calibrated Gaussian noise before sharing, buying a formal (ε, δ) guarantee. Nothing is free: the noise is what you pay. Drag ε from strict to loose and watch the forecast recover. The curve on the right is the whole privacy–utility trade-off; the dashed line is the no-privacy baseline and the grey line is a predictor that always guesses the mean.

private NRMSE
exact NRMSE
noise σ
usable?

7 · Learning online when the world changes

The readout can be trained one sample at a time by recursive least squares, without ever re-solving from scratch. That matters when the data is not stationary. Halfway through the stream the target rule changes (marked by the line). A readout that remembers everything equally is dragged back by the old regime; one with a forgetting factor below 1 down-weights the past and re-locks onto the new rule. Turn forgetting down and watch the error recover faster — at the cost of being jumpier when the data is merely noisy.

step0
recent error
regimeA
target online prediction error

8 · Short-term memory how far back it remembers

Can the reservoir reconstruct the input it saw k steps ago? Each bar is the recovery (R², 0–1) at delay k. Memory fades with delay, and reaches further as the spectral radius approaches 1.

9 · Speaker ID on Japanese Vowels classification · real data

A real UCI benchmark: classify which of 9 speakers uttered a short Japanese vowel (12-dimensional cepstral frames). Each speaker is one federated client — an extreme label skew. Centralized and federated agree exactly and get it right; a local-only client (which has only ever heard one speaker) is stuck at chance. Press play to cycle through held-out test utterances, or scrub to pick one.

loading…