ArticleslgStudy

computer science

Generalized Hebbian algorithm

Generalized Hebbian algorithm is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Generalized Hebbian algorithm rather than just read about it. In short: The generalized Hebbian algorithm, also known in the literature as Sanger's rule, is a linear feedforward neural network for unsupervised learning with applications primarily in principal components analysis. First defined in 1989, it is similar to Oja's rule in its formulation and stability, except it can be applied to networks with multiple outputs.

Generalized Hebbian algorithm — main illustration
Generalized Hebbian algorithm — illustration

Key takeaways

  • Generalized Hebbian algorithm belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Generalized Hebbian algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Generalized Hebbian algorithm from memory before moving on to harder problems.

Reference excerpt

The generalized Hebbian algorithm, also known in the literature as Sanger's rule, is a linear feedforward neural network for unsupervised learning with applications primarily in principal components analysis. First defined in 1989, it is similar to Oja's rule in its formulation and stability, except it can be applied to networks with multiple outputs. The name originates because of the similarity between the algorithm and a hypothesis made by Donald Hebb about the way in which synaptic strengths in the brain are modified in response to experience, i.e., that changes are proportional to the correlation between the firing of pre- and post-synaptic neurons.

Theory Consider a problem of learning a linear code for some data. Each data is a multi-dimensional vector x∈ℝn, and can be (approximately) represented as a linear sum of linear code vectors w1,…,wm∈ℝn. When m=n, it is possible to exactly represent the data. If m<n, it is possible to approximately represent the data. To minimize the L2 loss of representation, w1,…,wm 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 input neurons and m output neurons y1,…,ym. The linear code vectors are the connection strengths, that is, wij is the synaptic weight or connection strength between the j-th input and i-th output neurons. The generalized Hebbian algorithm learning rule is of the form

Δwij = ηyi(xj−∑k=1iwkjyk) where η is the learning rate parameter.

Derivation In matrix form, Oja's rule can be written

dw(t)dt = w(t)Q−diag[w(t)Qw(t)T]w(t), and the Gram-Schmidt algorithm is

Δw(t) = −lower[w(t)w(t)T]w(t), 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 sets all matrix elements outside of the diagonal equal to 0, 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,

Δw(t) = η(t)(𝐲(t)𝐱(t)T−LT[𝐲(t)𝐲(t)T]w(t)), 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.

Stability and Principal Components Analysis

Oja's rule is the special case where m=1. One can think of the generalized Hebbian algorithm as iterating Oja's rule. With Oja's rule, w1 is learned, and it has the same direction as the largest principal component vector is learned, with length determined by E[xj]=E[w1jy1] for all j, where the expectation is taken over all input-output pairs. In other words, the length of the vector w1 is such that we have an autoencoder, with the latent code y1=∑iw1ixi, such that E[‖x−y1w1‖2] is minimized. When 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 w1 has converged, the second neuron is effectively running another Oja's rule on the modified input vectors, defined by x′=x−y1w1, 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 principal components for arbitrary m.

Applications 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 η.

As an example, (Olshausen and Field, 1996) 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 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.

See also Hebbian learning Factor analysis Contrastive Hebbian learning Oja's rule BCM theory List of artificial intelligence algorithms

References

Illustrations

Generalized Hebbian algorithm: Features found by Principal Component Analysis on the same Caltech 101 dataset
Features found by Principal Component Analysis on the same Caltech 101 dataset

Worked examples

Example 1 — a first encounter with Generalized Hebbian algorithm

Start with the simplest possible case. Write down what Generalized Hebbian algorithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Generalized Hebbian algorithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Generalized Hebbian algorithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Generalized Hebbian algorithm

In research
Generalized Hebbian algorithm appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Generalized Hebbian algorithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Generalized Hebbian algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Artificial neural networks, Hebbian theory, so understanding it makes those chapters shorter.
In everyday life
Look for Generalized Hebbian algorithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Generalized Hebbian algorithm” →

How to study Generalized Hebbian algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Generalized Hebbian algorithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Generalized Hebbian algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Generalized Hebbian algorithm in simple terms?

The generalized Hebbian algorithm, also known in the literature as Sanger's rule, is a linear feedforward neural network for unsupervised learning with applications primarily in principal components analysis. First defined in 1989, it is similar to Oja's rule in its formulation and stability, excep…

Why does Generalized Hebbian algorithm matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Generalized Hebbian algorithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Generalized Hebbian algorithm.

Tags

  • Artificial neural networks
  • Hebbian theory

Keep exploring