Section 1
A pond that remembers
Picture a pond. A stone makes ripples that spread and fade over several seconds, and the surface still carries a trace of the stone long after it sank. An echo state network works in the same way. Its recurrent and input weights are set once, so that the hidden state echoes past inputs. Only a readout from the state is trained.
The book calls this idea reservoir computing, after the reservoir of temporal features formed by the hidden units. The recurrent and input weights are not learned. Only the output weights are, and the book notes that this makes the training criterion convex in those weights when the criterion is mean squared error.
Click any coloured symbol to see what it means.
Added hereThis update is added here and is not printed in the book. It is the recurrence of Section 10.2 without the bias and the output, with the weights fixed rather than learned.
Predict before you look. A reservoir at spectral radius 0.3 and another at 0.8 are each asked to recall the input from 10 steps ago. Which one recalls it better?
Predict, then reveal
Choose one. The result appears after you choose.
Section 2
Reading the memory from the state
A readout is a linear map from the state to a prediction. To test memory, the readout predicts the input from steps ago. The score is the normalized mean squared error, . A score of 0 is a perfect prediction, and a score of 1 is no better than predicting the average of the target.
Click any coloured symbol to see what it means.
The readout weights are fitted by ridge regression, which is linear regression with a small penalty that keeps the solution stable. This fit is added here and is not printed in the book.
Click any coloured symbol to see what it means.
Memory of the reservoir
NMSE for each delay0.5 line
Challenge +8 XPSet the delay to and choose a spectral radius that brings the below 0.5.
How the split is set
The reservoir has 30 hidden units. Counting steps from 0, steps 0 to 60 are discarded to wash out the zero start. The states at steps 61 to 249 train the readout, and the states at steps 250 to 399 test it. The input is a random sequence with values between minus one and one. The ridge term is 1e-6. All of this is added here and is not printed in the book.
Section 3
Forgetting and the edge of stability
The book says that the spectral radius of the Jacobian matters. It defines the spectral radius as the largest absolute value of an eigenvalue of the Jacobian, and the same definition holds for a matrix.
Click any coloured symbol to see what it means.
For a linear map, a difference along an eigenvector is multiplied by its eigenvalue at every step, so a spectral radius above one grows and one below one shrinks. The book notes that the derivative of the nonlinearity approaches zero on many steps, which helps prevent explosion. It also says that the most recent work on echo state networks advocates a spectral radius much larger than one, citing Yildiz et al. (2012) and Jaeger (2012).
How fast two states forget
Challenge +8 XPChoose a spectral radius so that the gap after 30 steps is at least 0.1.
The book’s contractive wordingThe book says that when the spectral radius is less than one, the map from to is contractive, so a small change becomes smaller after each step. The demo shows the difference shrinking over many steps, which is a long-run statement. Section 5 shows that one step of a non-normal matrix can still stretch a vector. That example is added here and is not printed in the book.
Section 4
Learning only the readout
With the states fixed, the training criterion depends only on the readout weights. For a linear readout and a mean squared error, the criterion is a quadratic bowl in those weights. The book says this is what makes the problem convex, so simple methods solve it reliably.
Click any coloured symbol to see what it means.
Here is the average outer product of two states, is the average product of each state with its target, and is the average of the squared target. These three averages are added here and are not printed in the book. The bowl has one lowest point, and the readout weights that reach it are the fitted weights.
The bowl of the readout
lowest errorcurrent weights
Challenge +8 XPMove the two readout weights until the is below 0.12.
What the bowl is built fromThe two readout weights read two of the thirty hidden units, the first and the sixth. The delay is 3 and the reservoir has spectral radius 0.9. The bowl is a fixed quadratic: the demo does not train a network.
Section 5
Separation and non-normal matrices
Take two states that start close together and follow the same input. Their gap changes at the rate set by the transition, as in the perturbation argument of Section 8.2.5. For a pair of complex eigenvalues, the transition is a rotation with a scale, so the length of the gap is multiplied by exactly the same factor at every step. For a real pair the gap depends on its direction.
The book notes that neither the recurrent weights nor the Jacobian need be symmetric, so their eigenvalues can be complex, and that complex eigenvalues describe potentially oscillatory behavior. The demo below compares the two pairs for the same starting direction.
Separation of a perturbation
Challenge +8 XPSwitch to the complex pair and choose the scale so that the separation after 10 steps is between 0.08 and 0.12.
Real pair, added hereThe real pair in the demo is a rotation by 30 degrees applied to a diagonal matrix with entries r and half of r. This example is added here and is not printed in the book.
The book’s contractive wording refers to the long run, and a single step can behave differently when the matrix is not normal. Take a matrix with the same eigenvalue twice and a large entry above the diagonal. Its eigenvalues are both one half, so its spectral radius is one half, yet one step stretches some unit vectors a great deal.
A matrix with spectral radius one half
unit circleimage after one step
Challenge +8 XPSet the off-diagonal entry so that one step stretches a unit vector by at least 5 times, while the spectral radius stays at 0.5.
Summary
- An echo state network fixes its recurrent and input weights and learns only a linear readout, which makes the training criterion convex.
- The memory of a reservoir, measured by , depends on the spectral radius and on the delay, and it falls as the delay grows.
- The book’s spectral radius is the largest eigenvalue in size. A radius below one forgets the past over many steps, and the book advocates radii above one for reservoirs.
- For a non-normal matrix, the spectral radius alone does not bound the stretch of a single step.
Final quizCheck yourself
Questions that mix the whole module. Each one is scored, and the score feeds your mastery of this module.
Source: Ian Goodfellow, Yoshua Bengio and Aaron Courville, Deep Learning, MIT Press, 2016, Section 10.8 (pages 404–405), free to read at deeplearningbook.org. Where the book prints equation numbers, the numbers here follow the book. The order of ideas follows the book. The explanations and all demos were written for this page.