screwing around with active inference
This example models a debugging decision as a two-option active-inference problem, showing how free-energy calculations shift between the actions of fixing a bug yourself versus asking a colleague. It displays a text-based simulation tracking free energy, beliefs, and the chosen action over 30 steps in the terminal. The Python script uses NumPy’s `log` function to compute free energy from belief, complexity, and prior terms, and iteratively updates beliefs via multiplicative decay. A second script extends the model into an interactive, multi-step decision tool that asks users for problem, actions, initial beliefs, priors, and complexities, then recommends the action with the lowest free energy.