pyhgf: A neural network library for predictive coding

Nicolas Legrand, Lilian Weber, Peter Thestrup Waade, Anna Hedvig Møller Daugaard, Mojtaba Khodadadi, Nace Mikuš, Christoph Mathys, Paul Bays, Paul Bays, Paul Bays · 2026

Read pyhgf: A neural network library for predictive coding by Nicolas Legrand, Lilian Weber, Peter Thestrup Waade, Anna Hedvig Møller Daugaard, Mojtaba Khodadadi, Nace Mikuš, Christoph Mathys, Paul Bays, Paul Bays, Paul Bays (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/PMC13318038.txt.

Description

Nicolas Legrand and colleagues introduce pyhgf in a 2026 software paper, a Python library for predictive coding, the theory that brains learn by constantly predicting sensory input and updating on errors. Standard neural network tools force these models into shapes that fight their biology.

Built on JAX and Rust, the package keeps network parts transparent and changeable during message passing, so belief updates can reorganize the network itself. That openness lets one framework express structure learning, meta-learning, and causal discovery as natural growth from surprise. Core functions stay differentiable for sampling and optimization workflows. Ready examples include general Bayesian filtering and the hierarchical Gaussian filter used in brain research, easing adoption by labs.

Catalog record

CREATORNicolas Legrand, Lilian Weber, Peter Thestrup Waade, Anna Hedvig Møller Daugaard, Mojtaba Khodadadi, Nace Mikuš, Christoph Mathys, Paul Bays, Paul Bays, Paul Bays
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE76609
LICENSEhttps://creativecommons.org/licenses/by/4.0
RIGHTSCC BY
SOURCEEurope PMC

Source: https://europepmc.org/article/MED/PMC13318038

Browse the full library · About the Tower of Babel