Implementation of the Bienenstock-Cooper-Munro (BCM) learning rule in PyTorch
- Final Project for the course Neural Information Processing 2025
- Demonstrates how the threshold adapts based on postsynaptic activity history and how weights develop orientation selectivity
- BCM Implementation is based on the plasticity package, which I rewrote, translated into PyTorch and to which I added timescales for threshold and weight adaption
- Check out the full report
Weights develop orientation selectivity

8 orientations evenly spaced over 180°.

Weights for tau_th = 0.1 and
tau_w = 0.05

Weights for tau_th = 0.1 and
tau_w = 0.001
Threshold preventing runaway activity
The threshold is successfully regulating the activity. Looking at t=20 and t=25, the spike in activation is picked up by the threshold and the activation in the next step is reduced.

The activity and threshold of a single neuron while training.