← all repositories

mpezeshki/pytorch_forward_forward

PyTorch implementation of Geoffrey Hinton's forward-forward neural network training algorithm that replaces back-propagation with local objective functions.

1.5k stars Python ML Frameworks
pytorch_forward_forward
Velocity · 7d
+1.2
★ / day
Trend
steady
star history

This repository implements the forward-forward (FF) training algorithm for neural networks. Unlike conventional backpropagation, FF computes gradients locally using a local objective function at each layer, eliminating the need to backpropagate errors. The algorithm trains layers by distinguishing positive samples (real data) from negative samples (generated fakes) based on layer output magnitudes relative to thresholds. After training all layers, predictions are made by finding the label that maximizes overall network activation. The implementation achieves around 6.8% test error on MNIST.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.