<!-- Generated by scripts/sync-agent-content.mjs. Edit the shared public sources, then regenerate. -->
# Learning Rules

Interactive experiments in learning, PCA and forgetting.

- Dates: 2026
- Status: ML demonstrations
- Areas: Software engineering; AI / ML
- Stack: Python · NumPy · JavaScript
- Topics: Python; JavaScript; Machine Learning; Algorithms; Research
- Public case study: https://mgiorgetti.com/project_details/project-pead.html

## Problem

Learning rules are easier to understand when their effects on weights, predictions, geometry and earlier tasks can be inspected step by step.

## Contribution

Course-project demonstrations of Hebbian learning, backpropagation, Oja's rule and continual-learning behavior, using Python/NumPy calculations and browser visualization.

## Technical approach and public case study

Small experiments that make learning visible: follow the weights, compare update rules, and see what a network forgets.

- PEAD course project

- Python · NumPy

- Browser visualization

### Two ways to learn from the same examples

#### Hebbian updates

Fruit features and the expected class strengthen their connections together. The visualization exposes the individual weights rather than hiding the update inside a library.

#### Backpropagation

Prediction error flows back through the network to adjust the weights. Training-step responses let the browser show changes in predictions, loss and connections.

### A neuron finds a direction

An Oja neuron learns the first principal component of a two-dimensional dataset. The browser displays the learned direction alongside the data, connecting a weight update to a geometric interpretation.

**Input**

A small two-dimensional dataset with a dominant direction.

**Update**

Observe how the neuron’s weights move as it learns.

**Geometry**

Compare the learned vector with the data’s principal axis.

### What happens when the task changes?

- Learn Task A Train a small ReLU network on the first classification task.

- Switch to Task B Continue learning and observe how performance on Task A changes.

- Compare EWC Use an empirical Fisher estimate to penalize changes to parameters important for the earlier task.

### Built to explain the mechanism

The experiments use small datasets and inspectable calculations. They illustrate how learning rules behave; they are not a benchmark of large-scale continual learning.

## Results and limitations

The experiments use small datasets and inspectable calculations. They explain learning mechanisms and forgetting; they are not a benchmark of large-scale continual learning.

## Public supporting links

- [Portfolio case study](https://mgiorgetti.com/project_details/project-pead.html)
- [Explore the source](https://github.com/Inventure72/PEADProject)
- [Matteo Giorgetti profile](https://mgiorgetti.com/profile.md)
