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

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.