Uploaded April 2026 | Updated November 2026, 8 hours ago
github.com/infer-actively/pymdp
A Python package for simulating Active Inference agents in Markov Decision Process environments. Please see our companion paper, published in the Journal of Open Source Software: "pymdp: A Python library for active inference in discrete state spaces" for an overview of the package and its motivation. For a more in-depth, tutorial-style introduction to the package and a mathematical overview of active inference in Markov Decision Processes, see the longer arxiv version of the paper.
pymdp-rtd.readthedocs.io/en/latest
pymdp is a Python package for simulating Active Inference agents in discrete-state Markov Decision Process environments.
-
--- RESOURCES & TRANSCRIPT ---
đź“„ Full Transcript on GitHub:
github.com/ActiveInferenceInstitute/ActiveInferenceJournal/tree/main/data/video/activeinferenceinstitute/ModelStream/ModelStream_007
Active Inference Institute information:
Website: https://www.activeinference.institute/
Activities: https://activities.activeinference.institute/
Discord: https://discord.activeinference.institute/
Donate: http://donate.activeinference.institute/
YouTube: youtube.com/c/ActiveInference
X: https://x.com/InferenceActive
Active Inference Livestreams: https://video.activeinference.institute/
------
CHAPTERS
0:00 Welcome and introductions
1:30 pymdp 1.0: a JAX-first release
3:00 Compilation to XLA
4:30 Uses in computational neuroscience
6:00 Contributors
7:30 Batching agents in parallel
9:00 Fast agent-environment loops
10:30 Array conventions in JAX
12:00 Random keys for sampling
13:30 Just-in-time compilation
15:00 Replacing for loops with scan
16:30 JIT warm-up and speed
18:00 Homogeneous and heterogeneous agents
19:30 A stateless inference API
21:00 Specifying models with dictionaries
22:30 Semantic labels for tensors
24:00 Filling in probabilities
25:30 Benchmarks
27:00 Comparison with other implementations
30:00 Throughput across time horizons
33:00 Sophisticated inference
37:30 Inductive inference
39:00 How the inductive planner works
40:30 Sparse dependencies between factors
42:00 Fitting models to behavioral data
43:30 Example: parameter recovery with NUTS
45:00 Recap of new features
46:30 Acknowledgments
48:00 Documentation walkthrough
51:00 Rollouts across agents and environments
52:30 Building a model from labels
54:00 Variational model fitting
55:30 Neural network front ends
57:00 Discussion: design and modularity
1:01:30 Discussion: adding learning algorithms
1:04:30 Discussion: pluggable inference functions
1:07:30 Discussion: continuous state spaces
1:09:00 Discussion: tuning sophisticated inference
1:13:30 Discussion: sensible defaults
1:15:00 Discussion: model-fitting tools
1:16:30 Discussion: planning without tree search
1:18:00 Questions from the live chat
1:19:30 How to contribute
1:22:30 Guidance on AI-generated contributions
1:24:00 Closing
github.com/infer-actively/pymdp
A Python package for simulating Active Inference agents in Markov Decision Process environments. Please see our companion paper, published in the Journal of Open Source Software: "pymdp: A Python library for active inference in discrete state spaces" for an overview of the package and its motivation. For a more in-depth, tutorial-style introduction to the package and a mathematical overview of active inference in Markov Decision Processes, see the longer arxiv version of the paper.
pymdp-rtd.readthedocs.io/en/latest
pymdp is a Python package for simulating Active Inference agents in discrete-state Markov Decision Process environments.
-
--- RESOURCES & TRANSCRIPT ---
đź“„ Full Transcript on GitHub:
github.com/ActiveInferenceInstitute/ActiveInferenceJournal/tree/main/data/video/activeinferenceinstitute/ModelStream/ModelStream_007
Active Inference Institute information:
Website: https://www.activeinference.institute/
Activities: https://activities.activeinference.institute/
Discord: https://discord.activeinference.institute/
Donate: http://donate.activeinference.institute/
YouTube: youtube.com/c/ActiveInference
X: https://x.com/InferenceActive
Active Inference Livestreams: https://video.activeinference.institute/
------
CHAPTERS
0:00 Welcome and introductions
1:30 pymdp 1.0: a JAX-first release
3:00 Compilation to XLA
4:30 Uses in computational neuroscience
6:00 Contributors
7:30 Batching agents in parallel
9:00 Fast agent-environment loops
10:30 Array conventions in JAX
12:00 Random keys for sampling
13:30 Just-in-time compilation
15:00 Replacing for loops with scan
16:30 JIT warm-up and speed
18:00 Homogeneous and heterogeneous agents
19:30 A stateless inference API
21:00 Specifying models with dictionaries
22:30 Semantic labels for tensors
24:00 Filling in probabilities
25:30 Benchmarks
27:00 Comparison with other implementations
30:00 Throughput across time horizons
33:00 Sophisticated inference
37:30 Inductive inference
39:00 How the inductive planner works
40:30 Sparse dependencies between factors
42:00 Fitting models to behavioral data
43:30 Example: parameter recovery with NUTS
45:00 Recap of new features
46:30 Acknowledgments
48:00 Documentation walkthrough
51:00 Rollouts across agents and environments
52:30 Building a model from labels
54:00 Variational model fitting
55:30 Neural network front ends
57:00 Discussion: design and modularity
1:01:30 Discussion: adding learning algorithms
1:04:30 Discussion: pluggable inference functions
1:07:30 Discussion: continuous state spaces
1:09:00 Discussion: tuning sophisticated inference
1:13:30 Discussion: sensible defaults
1:15:00 Discussion: model-fitting tools
1:16:30 Discussion: planning without tree search
1:18:00 Questions from the live chat
1:19:30 How to contribute
1:22:30 Guidance on AI-generated contributions
1:24:00 Closing









![ActInf ModelStream 026.1: Closed-form predictive coding via hierarchical Gaussian filters, Baskakovs
Closed-form predictive coding via hierarchical Gaussian filters https://arxiv.org/abs/2605.20293
Aleksandrs Baskakovs, Sylvain Estebe, Kenneth Enevoldsen, Kristoffer Nielbo, Chris Mathys, Nicolas Legrand
Predictive coding (PC) offers a local and biologically grounded alternative to backpropagation in the training of artificial neural networks, yet to date, it remains slower, and performance degrades sharply as network depth increases. We trace both problems to a single simplification: current PC networks fix the precision matrix to the identity, discarding precision-weighted prediction errors that the variational derivation requires to be fast, local, and Bayesian. We close this gap by expressing predictive coding networks as deep hierarchical Gaussian filters (HGFs) and restore precision-weighted message passing, yielding dynamic uncertainty estimates and Hebbian-compatible update rules at every layer. The resulting networks can simultaneously learn activations, weights, and precisions under a single free-energy objective, with no global error signal, and resolve inference without requiring iterations or automatic differentiation. On FashionMNIST, our solution approaches backpropagation in epoch-level wall-clock cost while converging in fewer epochs, and outperforms it on online, data efficiency, and concept-drift tasks. We thus establish that closed-form variational inference with online precision learning provides a tractable foundation for deep predictive coding networks, retaining biological and interpretative advantages, without requiring iterative relaxation or global error signals.
Subjects: Machine Learning (cs.LG); Artificial Intelligence (cs.AI); Neural and Evolutionary Computing (cs.NE)
Cite as: arXiv:2605.20293 [cs.LG]
(or arXiv:2605.20293v1 [cs.LG] for this version)
https://doi.org/10.48550/arXiv.2605.20293
[Submitted on 19 May 2026]
Active Inference Institute information:
Website: https://www.activeinference.institute/
Activities: https://activities.activeinference.institute/
Discord: https://discord.activeinference.institute/
Donate: http://donate.activeinference.institute/
YouTube: https://www.youtube.com/c/ActiveInference/
X: https://x.com/InferenceActive
Active Inference Livestreams: https://video.activeinference.institute/
CHAPTERS
0:00 Welcome and introductions
1:30 Talk outline
3:00 Background: training networks with backpropagation
6:00 Limits of backprop: offline learning and forgetting
9:00 Predictive coding and local learning rules
12:00 Prospective configuration
13:30 Analogy: reaching agreement in a network
18:00 Problems: slow inference and signal attenuation
19:30 Nodes as agents, not cogs
21:00 Precision and Bayesian belief updating
24:00 Injecting uncertainty over time
25:30 Hierarchical Gaussian filters: volatility coupling
27:00 From HGFs to predictive coding networks
28:30 Children send precision to parents
30:00 Precision-weighted learning and plasticity
31:30 Benchmarks vs. backprop and predictive coding networks
33:00 One inference pass in deep networks
34:30 Online and continual learning
36:00 Label-switching tasks
37:30 Summary: deep HGF networks
39:00 Future directions
40:30 Q&A
42:00 Q&A: batch vs. online learning
43:30 Q&A: time-series data
46:30 Q&A: depth and training time
49:30 Q&A: networks that choose their own update rules
52:30 Q&A: specifying the state space
55:30 Q&A: uncertainty for action
57:00 Q&A: optimizers in the benchmarks
58:30 Q&A: transformer architectures in the toolbox
1:01:30 Q&A: parameters per node
1:03:00 Q&A: interpretability
1:04:30 Q&A: applications and LLM agents
1:07:30 Closing thoughts ActInf ModelStream 026.1: Closed-form predictive coding via hierarchical Gaussian filters, Baskakovs](https://i.ytimg.com/vi/gcLQx0nAww0/mqdefault.jpg)
