- ruleregola
- rivalrivale
- \(e_1\)
A single linear neuron with output \(v = w \cdot u\) sees the points \(u\) of a cloud in the plane one at a time, in a new random order at every epoch, and after each of them changes its weights \(w\) by a rule that uses only what the synapse can know: the input \(u\), the output \(v\) and, for some of the rules, a running average. The five rules are those of the second laboratory of a course of Computational Neuroscience, with its data, learning rates and numbers of epochs: Hebb's rule, Oja's rule, subtractive normalization, the BCM rule and the covariance rule. Averaged over the points, each of them is a gradient ascent on a function of \(w\) (the mean square of the output, the same function restricted to a circle or to a line, a measure of skewness), and the stream of the points makes it a stochastic ascent. The figures follow the weight vector against the principal eigenvector \(e_1\) of the correlation matrix \(Q = \langle u u^\top \rangle\), which most of the rules find (as the power method does, when nothing stops the growth of \(|w|\)).
Un singolo neurone lineare con uscita \(v = w \cdot u\) vede i punti \(u\) di una nuvola nel piano uno alla volta, in un nuovo ordine casuale a ogni epoca, e dopo ciascuno di essi cambia i suoi pesi \(w\) con una regola che usa solo ciò che la sinapsi può conoscere: l'ingresso \(u\), l'uscita \(v\) e, per alcune delle regole, una media mobile. Le cinque regole sono quelle del secondo laboratorio di un corso di Computational Neuroscience, con i suoi dati, i suoi passi di apprendimento e i suoi numeri di epoche: la regola di Hebb, la regola di Oja, la normalizzazione sottrattiva, la regola BCM e la regola della covarianza. In media sui punti ciascuna di esse è una salita lungo il gradiente di una funzione di \(w\) (il quadrato medio dell'uscita, la stessa funzione ristretta a una circonferenza o a una retta, una misura di asimmetria), e il flusso dei punti ne fa una salita stocastica. Le figure seguono il vettore dei pesi rispetto all'autovettore principale \(e_1\) della matrice di correlazione \(Q = \langle u u^\top \rangle\), che quasi tutte le regole trovano (come il metodo delle potenze, quando nulla ferma la crescita di \(|w|\)).
With a small \(\eta\) the weights change little within an epoch, and the rule follows, up to fluctuations of order \(\eta\), the ordinary differential equation obtained by averaging the update over the points. For Hebb's rule the average of \(v u = u u^\top w\) is \(Q w\), so that \(\dot w = Q w\), whose solution \(w(t) = \sum_i c_i\, e^{\lambda_i t} e_i\), with \(\lambda_1 \ge \lambda_2 \ge 0\) the eigenvalues of \(Q\) and \(e_i\) its eigenvectors, grows along every eigenvector and fastest along \(e_1\): the direction of \(w\) converges to \(\pm e_1\), as in the power method, while \(|w|\) grows as \(e^{\eta \lambda_1 t}\) with \(t\) the number of points presented. The rule is the stochastic gradient of \(\tfrac12 v^2\), and its ascent on \(\tfrac12 \langle v^2 \rangle = \tfrac12 w^\top Q w\), a convex quadratic, has no maximum to stop at. Oja's rule is its normalized version: dividing \(w + \eta v u\) by its norm and expanding to first order in \(\eta\) around \(|w| = 1\) gives \(\Delta w = \eta\, v\, (u - v w)\), and the term \(-\eta v^2 w\) is the decay that keeps \(|w|\) near 1 (near \(1/\sqrt{\alpha}\) with the weight \(\alpha\) of the lab). On the circle the averaged update \(Q w - (w^\top Q w)\, w\) is the gradient of the Rayleigh quotient \(w^\top Q w / w^\top w\) projected on the tangent line, its maxima are \(\pm e_1\), and \(\pm e_2\) are saddles: Oja's neuron computes online the first principal component of the inputs.
Con un \(\eta\) piccolo i pesi cambiano poco nell'arco di un'epoca, e la regola segue, a meno di fluttuazioni di ordine \(\eta\), l'equazione differenziale ordinaria che si ottiene facendo la media dell'aggiornamento sui punti. Per la regola di Hebb la media di \(v u = u u^\top w\) è \(Q w\), così che \(\dot w = Q w\), la cui soluzione \(w(t) = \sum_i c_i\, e^{\lambda_i t} e_i\), con \(\lambda_1 \ge \lambda_2 \ge 0\) gli autovalori di \(Q\) ed \(e_i\) i suoi autovettori, cresce lungo ogni autovettore e più in fretta lungo \(e_1\): la direzione di \(w\) converge a \(\pm e_1\), come nel metodo delle potenze, mentre \(|w|\) cresce come \(e^{\eta \lambda_1 t}\) con \(t\) il numero di punti presentati. La regola è il gradiente stocastico di \(\tfrac12 v^2\), e la sua salita su \(\tfrac12 \langle v^2 \rangle = \tfrac12 w^\top Q w\), una quadratica convessa, non ha un massimo in cui fermarsi. La regola di Oja ne è la versione normalizzata: dividendo \(w + \eta v u\) per la sua norma e sviluppando al primo ordine in \(\eta\) attorno a \(|w| = 1\) si ottiene \(\Delta w = \eta\, v\, (u - v w)\), e il termine \(-\eta v^2 w\) è il decadimento che tiene \(|w|\) vicino a 1 (vicino a \(1/\sqrt{\alpha}\) con il peso \(\alpha\) del laboratorio). Sulla circonferenza l'aggiornamento medio \(Q w - (w^\top Q w)\, w\) è il gradiente del quoziente di Rayleigh \(w^\top Q w / w^\top w\) proiettato sulla retta tangente, i suoi massimi sono \(\pm e_1\), e \(\pm e_2\) sono punti di sella: il neurone di Oja calcola in linea la prima componente principale degli ingressi.
Subtractive normalization removes from the Hebbian update its component along \(n = (1, 1)\), so that the sum of the weights \(n \cdot w\) stays at its initial value: in the mean the rule is the gradient of \(\tfrac12 w^\top Q w\) projected on the line \(n \cdot w = n \cdot w_0\), a projected gradient ascent on a constraint that does not bound the norm, and \(w\) grows along the direction orthogonal to \(n\), which on the lab data lies at 0.26° from \(e_1\). The BCM rule replaces the fixed threshold of a covariance rule with one that slides with the square of the output, \(\theta \to \langle v^2 \rangle\), so that a neuron that fires too much raises its own threshold and the growth stops; with the threshold at its average, the update is the gradient of \(\tfrac13 \langle v^3 \rangle - \tfrac14 \langle v^2 \rangle^2\), which rewards the directions in which the output is skewed, large on a few inputs and small on the others. The lab cloud is two clusters placed symmetrically about the origin, along which every projection has nearly zero third moment, so that the objective is highest near \(w = 0\) and \(w\) shrinks slowly; on the two clusters of the cloud menu, which are not symmetric, the run becomes selective, with \(v\) near zero on one cluster and large on the other (the fixed point has \(v = 2\) there, and the run oscillates around it, since the threshold of the lab moves at the same rate as the weights, while the averaged analysis assumes that it moves faster). The covariance rule subtracts the mean input, and its ascent is on the variance of the output, \(\tfrac12 w^\top C w\): on centered data it is Hebb's rule, while on the rotated cloud off the origin, without centering, Hebb follows the principal eigenvector of \(Q\), which leans toward the mean, and the covariance rule that of \(C\), the axis of the cloud.
La normalizzazione sottrattiva toglie all'aggiornamento di Hebb la sua componente lungo \(n = (1, 1)\), così che la somma dei pesi \(n \cdot w\) resta al suo valore iniziale: in media la regola è il gradiente di \(\tfrac12 w^\top Q w\) proiettato sulla retta \(n \cdot w = n \cdot w_0\), una salita del gradiente proiettato su un vincolo che non limita la norma, e \(w\) cresce lungo la direzione ortogonale a \(n\), che sui dati del laboratorio sta a 0.26° da \(e_1\). La regola BCM sostituisce la soglia fissa di una regola della covarianza con una soglia che scorre con il quadrato dell'uscita, \(\theta \to \langle v^2 \rangle\), così che un neurone che scarica troppo alza la propria soglia e la crescita si ferma; con la soglia alla sua media, l'aggiornamento è il gradiente di \(\tfrac13 \langle v^3 \rangle - \tfrac14 \langle v^2 \rangle^2\), che premia le direzioni in cui l'uscita è asimmetrica, grande su pochi ingressi e piccola sugli altri. La nuvola del laboratorio è fatta di due gruppi disposti simmetricamente rispetto all'origine, lungo i quali ogni proiezione ha momento terzo quasi nullo, così che l'obiettivo è più alto vicino a \(w = 0\) e \(w\) si accorcia lentamente; sui due gruppi del menu delle nuvole, che non sono simmetrici, la corsa diventa selettiva, con \(v\) vicino a zero su un gruppo e grande sull'altro (il punto fisso ha lì \(v = 2\), e la corsa oscilla attorno a esso, poiché la soglia del laboratorio si muove con lo stesso passo dei pesi, mentre l'analisi in media suppone che si muova più in fretta). La regola della covarianza sottrae l'ingresso medio, e la sua salita è sulla varianza dell'uscita, \(\tfrac12 w^\top C w\): su dati centrati è la regola di Hebb, mentre sulla nuvola ruotata e lontana dall'origine, senza centrare, Hebb segue l'autovettore principale di \(Q\), che pende verso la media, e la regola della covarianza quello di \(C\), l'asse della nuvola.
The defaults of the scene are those of the MATLAB code of the lab: 100 points, a new permutation at every epoch, \(w\) drawn uniformly in \([-1, 1]^2\), \(\eta = 4 \cdot 10^{-4}\) for Hebb, \(5 \cdot 10^{-4}\) for Oja and the subtractive rule, \(5 \cdot 10^{-3}\) for BCM and the covariance rule, 1000 epochs (2000 for BCM), and \(\theta\) of BCM starting at \(-1\) and moving with the same \(\eta\). With these numbers the lab found \(|w| \approx 5.9 \cdot 10^8\) after 1000 epochs of Hebb and \(7.7 \cdot 10^{11}\) of the subtractive rule (the factor depends on \(w_0\); the rate does not, about \(e^{\eta \lambda_1 n}\) per epoch with \(n = 100\) points). For Oja the norm settles at 31.6, since the code weighs the decay with \(\alpha = 10^{-3}\) and \(1/\sqrt{\alpha} = 31.6\) (the value 1 of the menu is Oja's own normalization), while for BCM it falls to 0.63 after 2000 epochs, with \(w\) nearly along \(e_2\). Its covariance code subtracts from \(u\) the mean of its own two components, which makes it the subtractive rule with \(\eta = 5 \cdot 10^{-3}\), and \(|w|\) reaches \(5.7 \cdot 10^{125}\); here the covariance rule subtracts the mean \(\langle u \rangle\) over the cloud, as in Dayan and Abbott, and since the lab data are centered it diverges at the same rate.
I valori iniziali della scena sono quelli del codice MATLAB del laboratorio: 100 punti, una nuova permutazione a ogni epoca, \(w\) estratto uniformemente in \([-1, 1]^2\), \(\eta = 4 \cdot 10^{-4}\) per Hebb, \(5 \cdot 10^{-4}\) per Oja e per la regola sottrattiva, \(5 \cdot 10^{-3}\) per BCM e per la regola della covarianza, 1000 epoche (2000 per BCM), e la \(\theta\) di BCM che parte da \(-1\) e si muove con lo stesso \(\eta\). Con questi numeri il laboratorio trovava \(|w| \approx 5.9 \cdot 10^8\) dopo 1000 epoche di Hebb e \(7.7 \cdot 10^{11}\) della regola sottrattiva (il fattore dipende da \(w_0\); il tasso no, circa \(e^{\eta \lambda_1 n}\) per epoca con \(n = 100\) punti). Per Oja la norma si assesta a 31.6, poiché il codice pesa il decadimento con \(\alpha = 10^{-3}\) e \(1/\sqrt{\alpha} = 31.6\) (il valore 1 del menu è la normalizzazione di Oja), mentre per BCM scende a 0.63 dopo 2000 epoche, con \(w\) quasi lungo \(e_2\). Il suo codice della covarianza sottrae da \(u\) la media delle sue due componenti, il che ne fa la regola sottrattiva con \(\eta = 5 \cdot 10^{-3}\), e \(|w|\) arriva a \(5.7 \cdot 10^{125}\); qui la regola della covarianza sottrae la media \(\langle u \rangle\) sulla nuvola, come in Dayan e Abbott, e poiché i dati del laboratorio sono centrati diverge con lo stesso tasso.