#1425·examples

improvement for examples/mnist_forward_forward

Author: whubaichuanCreated Aug 30, 2026Updated Aug 30, 2026

Context

Hi, I am running the examples/mnist_forward_forward, which is based on https://github.com/mohammadpz/pytorch_forward_forward as described in main.py. This example can be improved a lot.

Your Environment

Expected Behavior

The test error is so high, not matching the results in FF paper. The lower the test error, the best the results, because test error is 100%-test accuracy.

Current Behavior

  1. This code (examples/mnist_forward_forward) cannot produce the expect results as in Hinton's FF paper. I am using the torch==2.13.0 and torchvision==0.28.0 and get around 7% test error while in hinton' paper this should be around 1%-2% test error.
  2. The base https://github.com/mohammadpz/pytorch_forward_forward shows that the test error is around 7%, which is not good.

Possible Solution

This repository can make the test error to 1% to 2 %, which is acknowledged by hinton in his previous homepge.

Steps to Reproduce

  1. Just run https://github.com/pytorch/examples/blob/main/mnist_forward_forward/main.py, and the high test error would be reproduced.

Failure Logs [if any]