/pypc

Predictive coding in Python

Primary LanguagePythonMIT LicenseMIT

An implementation of predictive coding in Python, utilising pytorch for GPU acceleration. We compare the use of the free energy as a loss function vs mean squared error. In addition we also test these predictive coding networks against a normal backpropagation network.

License: MIT

Running

Free Energy Loss Function

python -m scripts.supervised

Mean Squared Error Loss Function

python -m scripts.supervised_mse

Backpropagation

python -m scripts.supervised_bp

Requirements

  • numpy
  • torch
  • torchvision

Authors

Extended by