Echo State NetworksEcho state network

An echo state network is a recurrent network in which only the output is learned: a reservoir of \(N\) tanh units, whose input and recurrent weights are drawn at random and never trained, is driven by the input series, and its state \(x(t)\), a nonlinear echo of the recent inputs, is read by a linear readout \(\hat y(t) = W_{\text{out}}\,[1; x(t)]\). Fitting the readout on the states collected after a washout is a ridge regression, a strictly convex quadratic problem whose minimizer the normal equations give in closed form, while training all the weights of a recurrent network by backpropagation through time is a nonconvex problem, solved by a descent method that, in general, finds only a local minimum or a stationary point. The reservoir is of use only if its state forgets where it started (the echo state property), which for a spectral radius \(\rho\) of \(W\) below 1 is usually the case; the scene runs the benchmarks of the course labs, NARMA10 and Mackey-Glass, with the hyperparameters the lab selected by grid search, and trains beside the reservoir the input delayed network and the Elman network of the previous lab.

Una echo state network è una rete ricorrente in cui si apprende solo l'uscita: un serbatoio di \(N\) unità tanh, i cui pesi d'ingresso e ricorrenti sono estratti a caso e mai addestrati, è guidato dalla serie d'ingresso, e il suo stato \(x(t)\), un'eco non lineare degli ingressi recenti, è letto da un readout lineare \(\hat y(t) = W_{\text{out}}\,[1; x(t)]\). Stimare il readout sugli stati raccolti dopo un washout è una regressione ridge, un problema quadratico strettamente convesso il cui minimo è dato in forma chiusa dalle equazioni normali, mentre addestrare tutti i pesi di una rete ricorrente con la backpropagation through time è un problema non convesso, risolto da un metodo di discesa che, in generale, trova solo un minimo locale o un punto stazionario. Il serbatoio serve solo se il suo stato dimentica da dove è partito (la proprietà dell'eco), cosa che per un raggio spettrale \(\rho\) di \(W\) minore di 1 di solito accade; la scena usa i benchmark dei laboratori del corso, NARMA10 e Mackey-Glass, con gli iperparametri scelti dal lab per grid search, e addestra accanto al serbatoio la rete con ingressi ritardati e la rete di Elman del laboratorio precedente.

The whole series in the strip on top (grey the washout, white the design set on which the readout is fitted, lilac the test set; a click moves there), and below it a window of 240 steps around \(t\): the input \(u(t)\) in gold, the target \(y(t)\) and, dashed, the output \(\hat y(t)\) of the readout, which is not fitted on the targets of the test set.L'intera serie nella striscia in alto (in grigio il washout, in bianco l'insieme di progetto su cui si stima il readout, in lilla quello di test; un clic porta lì), e sotto una finestra di 240 passi intorno a \(t\): l'ingresso \(u(t)\) in oro, il bersaglio \(y(t)\) e, tratteggiata, l'uscita \(\hat y(t)\) del readout, che non è stimato sui bersagli dell'insieme di test.
design MSEMSE di progetto
design NMSENMSE di progetto
test MSEMSE di test
test NMSENMSE di test
The reservoir at step \(t\): each dot is a unit, violet when \(x_i(t) > 0\) and gold when negative, the chords the strongest entries of \(W\), and the bars outside the ring the terms \(W_{\text{out},i}\,x_i(t)\) that the readout adds up into \(\hat y(t)\), outwards when positive.Il serbatoio al passo \(t\): ogni punto è un'unità, viola quando \(x_i(t) > 0\) e oro quando negativa, le corde i termini più forti di \(W\), e le barre fuori dall'anello i termini \(W_{\text{out},i}\,x_i(t)\) che il readout somma in \(\hat y(t)\), verso l'esterno quando positivi.
The eigenvalues of \(W\) in the complex plane, after the scaling: the violet circle has radius \(\rho\), the dashed one radius 1. A new reservoir, a different \(N\) or connectivity draw a new \(W\); \(\rho\) only stretches the cloud.Gli autovalori di \(W\) nel piano complesso, dopo la scalatura: il cerchio viola ha raggio \(\rho\), quello tratteggiato raggio 1. Un nuovo serbatoio, un altro \(N\) o un'altra connettività estraggono una nuova \(W\); \(\rho\) dilata soltanto la nuvola.
The echo state property: two runs of the same reservoir on the same input, one from \(x(0) = 0\) and one from a random \(x'(0)\), and their distance, in log scale, over the first 300 steps. The condition usually quoted, \(\rho < 1\), is neither necessary nor sufficient: Jaeger's sufficient condition requires the largest singular value of \(W\) below 1, and a strong input drives the units into saturation, where \(\tanh\) contracts, so that a larger \(\omega\) restores the forgetting for \(\rho\) somewhat above 1.La proprietà dell'eco: due corse dello stesso serbatoio sullo stesso ingresso, una da \(x(0) = 0\) e una da un \(x'(0)\) casuale, e la loro distanza, in scala logaritmica, nei primi 300 passi. La condizione citata di solito, \(\rho < 1\), non è né necessaria né sufficiente: la condizione sufficiente di Jaeger richiede il massimo valore singolare di \(W\) minore di 1, e un ingresso forte porta le unità in saturazione, dove \(\tanh\) contrae, così che un \(\omega\) più grande ripristina l'oblio per \(\rho\) di poco sopra 1.

The readout \(W_{\text{out}}\), the bias first and then one bar per unit. With a small \(\lambda\) the weights grow large and of alternating sign, fitting the design set more closely than the test set allows.Il readout \(W_{\text{out}}\), prima il bias e poi una barra per unità. Con un \(\lambda\) piccolo i pesi crescono e alternano il segno, adattandosi all'insieme di progetto più di quanto l'insieme di test consenta.
The memory capacity of Jaeger (2002): on an input uniform in \([-0.8, 0.8]\), a readout for each delay \(k\) is trained to give back \(u(t-k)\), and \(\mathrm{MC}_k = r^2\big(u(t-k), y_k(t)\big)\) is the squared correlation on 1000 further steps; the sum over \(k\) is at most \(N\). A small \(\omega\) keeps the units nearly linear and the memory long, a \(\rho\) near 1 makes it longer.La capacità di memoria di Jaeger (2002): su un ingresso uniforme in \([-0.8, 0.8]\), per ogni ritardo \(k\) si addestra un readout a restituire \(u(t-k)\), e \(\mathrm{MC}_k = r^2\big(u(t-k), y_k(t)\big)\) è la correlazione al quadrato su altri 1000 passi; la somma su \(k\) non supera \(N\). Un \(\omega\) piccolo tiene le unità quasi lineari e la memoria lunga, un \(\rho\) vicino a 1 la allunga.

Against the networks of LAB3_1Contro le reti di LAB3_1

The input delayed network (IDNN) reads a window of the last \(d\) inputs, \(\hat y(t) = v^\top \tanh(A\,[u(t), \dots, u(t-d+1)] + b) + c\), and the Elman network keeps a state, \(h(t) = \tanh(a\,u(t) + W h(t-1) + b)\), \(\hat y(t) = v^\top h(t) + c\), whose weights are all trained, by backpropagation through time on chunks of 40 steps. Both are trained here with Adam on the same design set as the readout, with the sizes the lab selected, on standardized input and target; their test MSE is drawn at every epoch beside that of the reservoir.La rete con ingressi ritardati (IDNN) legge una finestra degli ultimi \(d\) ingressi, \(\hat y(t) = v^\top \tanh(A\,[u(t), \dots, u(t-d+1)] + b) + c\), e la rete di Elman tiene uno stato, \(h(t) = \tanh(a\,u(t) + W h(t-1) + b)\), \(\hat y(t) = v^\top h(t) + c\), i cui pesi sono tutti addestrati, con la backpropagation through time su tratti di 40 passi. Entrambe sono addestrate qui con Adam sullo stesso insieme di progetto del readout, con le dimensioni scelte dal lab, su ingresso e bersaglio standardizzati; il loro MSE di test è disegnato a ogni epoca accanto a quello del serbatoio.

epochepoca 0
The test MSE of the three models, in log scale: filled the runs of this page, dashed those the lab reports for the same task.L'MSE di test dei tre modelli, in scala logaritmica: pieni i valori di questa pagina, tratteggiati quelli che il lab riporta per lo stesso compito.
The test MSE of the IDNN and of the RNN along the epochs; the dashed line is the reservoir, whose readout needs no epochs.L'MSE di test della IDNN e della RNN lungo le epoche; la linea tratteggiata è il serbatoio, il cui readout non ha bisogno di epoche.

test MSE in the labMSE di test nel labESNIDNNRNN
NARMA101.81e-34.22e-32.39e-3
Mackey-Glass3.82e-51.36e-33.74e-4
Santa Fe laserlaser di Santa Fe2.85e-31.98e-25.57e-3

With the hyperparameters it selected, the lab found the reservoir best on all three benchmarks: on NARMA10 by a factor of 1.3 over the RNN and 2.3 over the IDNN, on Mackey-Glass by factors of 10 and 36, and on the laser series by 2 and 7 (the laser data come with MATLAB as laser_dataset and are not in the course repository, so the scene reports them without running them). In this page the ranking changes: trained with Adam instead of the gradient descent with adaptive step and weight decay of MATLAB, the RNN of the lab sizes reaches in 30 epochs a test MSE of about \(8 \cdot 10^{-4}\) on NARMA10 and \(10^{-5}\) on Mackey-Glass, below the reservoir with the settings of the lab (about \(10^{-3}\) and \(2.5 \cdot 10^{-5}\)). The IDNN gets about \(3 \cdot 10^{-5}\) on Mackey-Glass, since its window here starts from \(u(t)\), while the timedelaynet(1:d) of the lab starts from \(u(t-1)\). The results of the reservoir are limited mostly by the regularization of its readout: the grid of the lab stopped at \(\lambda = 10^{-4}\) from below and selected \(\lambda = 0.1\) for NARMA10, and with \(\lambda = 10^{-6}\) the test MSE of the reservoir on NARMA10 falls here to between \(5 \cdot 10^{-5}\) and \(9 \cdot 10^{-5}\) (depending on the draw of the reservoir), an order of magnitude below the RNN, while on Mackey-Glass, with \(N = 200\), \(\rho = 0.9\), \(\omega = 1\) and \(\lambda = 10^{-8}\), it falls below \(10^{-8}\). Of course, the IDNN gains from a different setting too: a window of \(d = 11\) inputs lets it see \(u(t-10)\), which NARMA10 multiplies by \(u(t-1)\) and the window of 3 selected by the lab cannot reach, and its test MSE falls to about \(5 \cdot 10^{-4}\), still above the reservoir with a small \(\lambda\).Con gli iperparametri che ha scelto, il lab ha trovato il serbatoio migliore su tutti e tre i benchmark: su NARMA10 di un fattore 1.3 sulla RNN e 2.3 sulla IDNN, su Mackey-Glass di fattori 10 e 36, e sulla serie del laser di 2 e 7 (i dati del laser vengono con MATLAB come laser_dataset e non sono nel repository del corso, quindi la scena ne riporta i risultati senza eseguirli). In questa pagina la classifica cambia: addestrata con Adam invece che con la discesa del gradiente a passo adattivo e weight decay di MATLAB, la RNN con le dimensioni del lab arriva in 30 epoche a un MSE di test di circa \(8 \cdot 10^{-4}\) su NARMA10 e \(10^{-5}\) su Mackey-Glass, sotto il serbatoio con i valori del lab (circa \(10^{-3}\) e \(2.5 \cdot 10^{-5}\)). La IDNN ottiene circa \(3 \cdot 10^{-5}\) su Mackey-Glass, perché la sua finestra qui parte da \(u(t)\), mentre la timedelaynet(1:d) del lab parte da \(u(t-1)\). I risultati del serbatoio sono limitati soprattutto dalla regolarizzazione del suo readout: la griglia del lab si fermava in basso a \(\lambda = 10^{-4}\) e per NARMA10 ha scelto \(\lambda = 0.1\), e con \(\lambda = 10^{-6}\) l'MSE di test del serbatoio su NARMA10 scende qui fra \(5 \cdot 10^{-5}\) e \(9 \cdot 10^{-5}\) (secondo l'estrazione del serbatoio), un ordine di grandezza sotto la RNN, mentre su Mackey-Glass, con \(N = 200\), \(\rho = 0.9\), \(\omega = 1\) e \(\lambda = 10^{-8}\), scende sotto \(10^{-8}\). Naturalmente anche la IDNN guadagna da un'altra scelta: una finestra di \(d = 11\) ingressi le permette di vedere \(u(t-10)\), che NARMA10 moltiplica per \(u(t-1)\) e che la finestra di 3 scelta dal lab non raggiunge, e il suo MSE di test scende a circa \(5 \cdot 10^{-4}\), ancora sopra il serbatoio con un \(\lambda\) piccolo.