infer-actively / pymdp

A Python implementation of active inference for Markov Decision Processes
MIT License
420 stars 83 forks source link

D vector learning #47

Closed conorheins closed 2 years ago

conorheins commented 2 years ago

New additions to pymdp that support updating dirichlet parameters (pD) over prior over initial states. This is the first step towards implementing "structure learning" in pymdp, which will consist into doing Bayesian model reduction using a combination of the posterior beliefs about the Dirichlet parameters of the generative model likelihoods (e.g. pA or pB) and posterior beliefs about the Dirichlet parameters of the generative model priors (for now, pD).

Additions include:

  1. new function for updating pD in learning.py module
  2. New method of Agent() class, called update_D(), that is compatible with the various sorts of posterior inference schemes available to theAgent(). I.e. it should work with both MMP-style inference (where posterior beliefs about both future and past hidden states, under all policies, are entertained) as well as "vanilla" inference (instantaneous posterior beliefs about only the current timestep, unconditioned on policies).
  3. Unit tests for features in points 1) and 2)