Skip to content

Commit

Permalink
Allow distributional observations in agent.infer_states()
Browse files Browse the repository at this point in the history
  • Loading branch information
conorheins committed Dec 8, 2022
1 parent 9eb1f81 commit 3bc77e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pymdp/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(
control_fac_idx=None,
policies=None,
gamma=16.0,
alpha = 16.0,
alpha=16.0,
use_utility=True,
use_states_info_gain=True,
use_param_info_gain=False,
Expand Down Expand Up @@ -394,7 +394,7 @@ def get_future_qs(self):
return future_qs_seq


def infer_states(self, observation):
def infer_states(self, observation, distr_obs = False):
"""
Update approximate posterior over hidden states by solving variational inference problem, given an observation.
Expand All @@ -414,7 +414,7 @@ def infer_states(self, observation):
at timepoint ``t_idx``.
"""

observation = tuple(observation)
observation = tuple(observation) if not distr_obs else observation

if not hasattr(self, "qs"):
self.reset()
Expand Down

0 comments on commit 3bc77e1

Please sign in to comment.