# mpezeshki/pytorch_forward_forward

Implementation of Hinton's forward-forward (FF) algorithm - an alternative to back-propagation

Repository: https://github.com/mpezeshki/pytorch_forward_forward
Canonical: https://ross.abutalabs.com/products/pytorch_forward_forward
Language: Python
License: MIT
License Family: permissive
Last push: 2023-09-06T02:29:56+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 0, release rhythm 35, longevity 97
- inputs: {"age_days": 1365, "days_push": 1093, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1500, forks 144 (observed 2026-08-28T04:04:54.251834+00:00)

## What it is
A PyTorch implementation of Geoffrey Hinton's forward-forward (FF) training algorithm, an alternative to back-propagation that computes gradients locally without backpropagating errors. It trains layer-by-layer with a local objective on positive and negative samples, demonstrated on MNIST.

## Use cases
- implement the forward-forward algorithm in pytorch
- train neural networks without backpropagation
- experiment with local learning objectives
- reproduce Hinton's forward-forward MNIST results
- study alternatives to backpropagation
- learn layer-wise training with positive and negative samples

## When to choose
- you want a reference implementation of the forward-forward algorithm
- you are researching backprop-free or local learning methods
- you want a small, readable PyTorch codebase to extend for FF experiments

## When to avoid
- you need state-of-the-art accuracy on large-scale vision or NLP tasks
- you need a maintained, production-ready training framework
- you need GPU-optimized, scalable training beyond MNIST-scale demos

## Facets
- artifact type: library
- maturity: maintenance
- function: machine-learning, deep-learning
- domain: machine-learning, deep-learning
- platform: python
- tags: forward-forward-algorithm, pytorch, neural-networks, research-code, mnist, hinton, algorithms

## Member repositories
- mpezeshki/pytorch_forward_forward (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:54.251834+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:33:00.570612+00:00, confidence not recorded.
  - readme: https://github.com/mpezeshki/pytorch_forward_forward (fetched 2026-08-28T04:04:54.251834+00:00, sha 98f8ee342647)
- Data as of 2026-08-30T08:39:29.467469+00:00.
