Consider a problem of learning a linear code for some data. Each data is a multi-dimensional vector x ∈ R n {\displaystyle x\in \mathbb {R} ^{n}} , and can be (approximately) represented as a linear sum of linear code vectors w 1 , … , w m {\displaystyle w_{1},\dots ,w_{m}} . When m = n {\displaystyle m=n} , it is possible to exactly represent the data. If m < n {\displaystyle m<n} , it is possible to approximately represent the data. To minimize the L2 loss of representation, w 1 , … , w m {\displaystyle w_{1},\dots ,w_{m}} should be the highest principal component vectors.
The generalized Hebbian algorithm is an iterative algorithm to find the highest principal component vectors, in an algorithmic form that resembles unsupervised Hebbian learning in neural networks.
Consider a one-layered neural network with n {\displaystyle n} input neurons and m {\displaystyle m} output neurons y 1 , … , y m {\displaystyle y_{1},\dots ,y_{m}} . The linear code vectors are the connection strengths, that is, w i j {\displaystyle w_{ij}} is the synaptic weight or connection strength between the j {\displaystyle j} -th input and i {\displaystyle i} -th output neurons.
The generalized Hebbian algorithm learning rule is of the form
where η {\displaystyle \eta } is the learning rate parameter.4
In matrix form, Oja's rule can be written
and the Gram-Schmidt algorithm is
where w(t) is any matrix, in this case representing synaptic weights, Q = η x xT is the autocorrelation matrix, simply the outer product of inputs, diag is the function that diagonalizes a matrix, and lower is the function that sets all matrix elements on or above the diagonal equal to 0. We can combine these equations to get our original rule in matrix form,
where the function LT sets all matrix elements above the diagonal equal to 0, and note that our output y(t) = w(t) x(t) is a linear neuron.5
6
Oja's rule is the special case where m = 1 {\displaystyle m=1} .7 One can think of the generalized Hebbian algorithm as iterating Oja's rule.
With Oja's rule, w 1 {\displaystyle w_{1}} is learned, and it has the same direction as the largest principal component vector is learned, with length determined by E [ x j ] = E [ w 1 j y 1 ] {\displaystyle E[x_{j}]=E[w_{1j}y_{1}]} for all j {\displaystyle j} , where the expectation is taken over all input-output pairs. In other words, the length of the vector w 1 {\displaystyle w_{1}} is such that we have an autoencoder, with the latent code y 1 = ∑ i w 1 i x i {\displaystyle y_{1}=\sum _{i}w_{1i}x_{i}} , such that E [ ‖ x − y 1 w 1 ‖ 2 ] {\displaystyle E[\|x-y_{1}w_{1}\|^{2}]} is minimized.
When m = 2 {\displaystyle m=2} , the first neuron in the hidden layer of the autoencoder still learns as described, since it is unaffected by the second neuron. So, after the first neuron and its vector w 1 {\displaystyle w_{1}} has converged, the second neuron is effectively running another Oja's rule on the modified input vectors, defined by x ′ = x − y 1 w 1 {\displaystyle x'=x-y_{1}w_{1}} , which we know is the input vector with the first principal component removed. Therefore, the second neuron learns to code for the second principal component.
By induction, this results in finding the top- m {\displaystyle m} principal components for arbitrary m {\displaystyle m} .
The generalized Hebbian algorithm is used in applications where a self-organizing map is necessary, or where a feature or principal components analysis can be used. Examples of such cases include artificial intelligence and speech and image processing.
Its importance comes from the fact that learning is a single-layer process—that is, a synaptic weight changes only depending on the response of the inputs and outputs of that layer, thus avoiding the multi-layer dependence associated with the backpropagation algorithm. It also has a simple and predictable trade-off between learning speed and accuracy of convergence as set by the learning rate parameter η.8
As an example, (Olshausen and Field, 1996)9 performed the generalized Hebbian algorithm on 8-by-8 patches of photos of natural scenes, and found that it results in Fourier-like features. The features are the same as the principal components found by principal components analysis, as expected, and that, the features are determined by the 64 × 64 {\displaystyle 64\times 64} variance matrix of the samples of 8-by-8 patches. In other words, it is determined by the second-order statistics of the pixels in images. They criticized this as insufficient to capture higher-order statistics which are necessary to explain the Gabor-like features of simple cells in the primary visual cortex.
Sanger, Terence D. (1989). "Optimal unsupervised learning in a single-layer linear feedforward neural network" (PDF). Neural Networks. 2 (6): 459–473. CiteSeerX 10.1.1.128.6893. doi:10.1016/0893-6080(89)90044-0. Retrieved 2007-11-24. /w/index.php?title=Terence_Sanger&action=edit&redlink=1 ↩
Hebb, D.O. (1949). The Organization of Behavior. New York: Wiley & Sons. ISBN 9781135631918. 9781135631918 ↩
Hertz, John; Anders Krough; Richard G. Palmer (1991). Introduction to the Theory of Neural Computation. Redwood City, CA: Addison-Wesley Publishing Company. ISBN 978-0201515602. 978-0201515602 ↩
Gorrell, Genevieve (2006), "Generalized Hebbian Algorithm for Incremental Singular Value Decomposition in Natural Language Processing.", EACL, CiteSeerX 10.1.1.102.2084 /wiki/CiteSeerX_(identifier) ↩
Haykin, Simon (1998). Neural Networks: A Comprehensive Foundation (2 ed.). Prentice Hall. ISBN 978-0-13-273350-2. 978-0-13-273350-2 ↩
Oja, Erkki (November 1982). "Simplified neuron model as a principal component analyzer". Journal of Mathematical Biology. 15 (3): 267–273. doi:10.1007/BF00275687. PMID 7153672. S2CID 16577977. BF00275687. /wiki/Erkki_Oja ↩
Olshausen, Bruno A.; Field, David J. (June 1996). "Emergence of simple-cell receptive field properties by learning a sparse code for natural images". Nature. 381 (6583): 607–609. doi:10.1038/381607a0. ISSN 1476-4687. PMID 8637596. https://www.nature.com/articles/381607a0 ↩