Evidence map›Paper›PMID 42330057›Full record

ArticlePLoS computational biology2026

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

Abstract read
In one paragraph

Article in PLoS computational biology, 2026. The graph could read no effect estimate from its abstract, so it casts no vote on the map. Cited by 1 paper.

0numbers the graph read from it
0cells of the map it votes in
1citing papers in PubMed
–field-weighted citation impact
1 · What the graph read from it

What it found

Each row is one number read from the abstract, on the scale the paper reported it, with its interval. Left of the dashed line favours the treatment, right favours the comparator. Under each row is the sentence it came from. New to these charts? A ten-minute tutorial.

The abstract states no effect estimate the extractor could read, or names no intervention and outcome on the map, so this paper lights no cell and moves no belief. It is still indexed, cited and linked below.

2 · The registry

The trial behind it

Trials whose registry record cites this paper, or whose number appears in the abstract. A trial that started after this paper was published is citing it as background, not reporting it.

Neither the registry nor the abstract names a trial number. If this is a trial report, that itself is worth knowing.

3 · Its place in the literature

Who cites it

1 citing paper in PubMed.

  1. Article
4 · The record

Corrections and comments

PubMed lists nothing against this paper. Absence here is not a guarantee, only a check that was made.

5 · Who and what money

Authors and funding

7 authors.

Nicolas LegrandInteracting Minds Centre, Aarhus University, Aarhus, Denmark.ORCID https://orcid.org/0000-0002-2651-4929
Lilian WeberDepartment of Psychiatry, University of Oxford, Oxford, United Kingdom.ORCID https://orcid.org/0000-0001-9727-9623
Peter Thestrup WaadeInteracting Minds Centre, Aarhus University, Aarhus, Denmark.
Anna Hedvig Møller DaugaardInteracting Minds Centre, Aarhus University, Aarhus, Denmark.
Mojtaba KhodadadiScuola Internazionale Superiore di Studi Avanzati (SISSA), Trieste, Italy.
Nace MikušInteracting Minds Centre, Aarhus University, Aarhus, Denmark.
Christoph MathysInteracting Minds Centre, Aarhus University, Aarhus, Denmark.ORCID https://orcid.org/0000-0003-4079-5453

Funding

No grant is acknowledged in the PubMed record.

6 · The paper itself

Abstract

Bayesian models of cognition have gained considerable traction in computational neuroscience and psychiatry. Their scope is now expected to expand rapidly to artificial intelligence, providing general inference frameworks to support embodied, adaptable, and energy-efficient autonomous agents. A central theory in this domain is predictive coding, which posits that learning and behaviour are driven by hierarchical probabilistic inferences about the causes of sensory inputs. Biological realism constrains these networks to rely on simple local computations in the form of precision-weighted predictions and prediction errors. This can make this framework highly efficient, but its implementation comes with unique challenges on the software development side. Embedding such models in standard neural network libraries often becomes limiting, as these libraries' compilation and differentiation backends can force a conceptual separation between optimisation algorithms and the systems being optimised. This critically departs from other biological principles such as self-monitoring, self-organisation, cellular growth, and functional plasticity. In this paper, we introduce pyhgf: a Python package backed by JAX and Rust for creating, manipulating, and sampling dynamic networks for predictive coding. We improve over other frameworks by enclosing the network components as transparent, modular, and malleable variables in the message-passing steps. The resulting graphs can implement arbitrary algorithms as belief propagation. Moreover, the transparency of core variables can also translate into inference processes that leverage self-organisation principles and express structure learning, meta-learning, or causal discovery as the consequence of network structural adaptation to surprising inputs. The main functions of the library are differentiable and seamlessly integrate into sampling or optimisation workflows. Additionally, we offer generalised Bayesian filtering and the hierarchical Gaussian filter as key examples of dynamic networks implemented in our library. The source code, tutorials, and documentation are hosted under the main repository at https://github.com/ComputationalPsychiatry/pyhgf.

Indexed as

Neural Networks, ComputerAlgorithmsBayes TheoremCognitionComputational BiologyHumansModels, NeurologicalSoftware

Identifiers

PMID42330057
PMCPMC13318038

What OpenQuestion holds

Textmetadata
LicenceCC BY
Read underepoch 390

Registered trials

None linked

Read under generation 80e0d062 · epoch 390. Bibliography from PubMed, PubMed Central and OpenAlex; grants from NIH RePORTER; trial links from ClinicalTrials.gov; estimates, votes and beliefs from the OpenQuestion graph.