Active Inference in Python
Overview
This skill provides a complete Active Inference implementation in Python, demonstrating Bayesian belief updating, variational free energy calculation, and expected free energy-based policy selection.
Core Algorithms
- Belief Updating: Bayesian inference using observation likelihoods to update posterior beliefs
- Free Energy Calculation: KL divergence between posterior beliefs and prior distribution
- Policy Selection: Softmax action selection over expected free energy per action
- Perception-Action Loop: Iterative sense → infer → act cycle with generative model
Key Files
config_manager.py— Source implementationserializer.py— Source implementationstudent_teacher.py— Source implementationteacher_wrapper.py— Source implementationtest_student_teacher.py— Source implementationrun.sh— Execution script (handles compilation if needed)README.md— Usage documentation and requirements
Usage
cd 0_CONTEXT/Computer_Languages/Python/
./run.sh
Language-Specific Features
- Rapid prototyping and iteration
- Dynamic typing flexibility
- Rich standard library
Integration
- Tested via
master_controller.py test python - Benchmarked via
benchmark_suite.py - Listed in
languages.jsonunder category "Scripting"
Prerequisites
See README.md for Python-specific installation requirements.