Closed conorheins closed 4 weeks ago
This is currently implemented in this branch: https://github.com/infer-actively/pymdp/tree/sparse_likelihoods_111
But I will leave the issue open until it's merged into master
Now merged into master via PR #132
allow users to specify an optional list of hidden state factor indices when passing in
A
andB
arrays, that specify which hidden state factors correspond to the lagging dimensions of these tensors. The purpose of this feature is to speed up computation speed and limit memory consumption. It leverages the (often-satisfied) assumption in generative models that not all observation modalities depend on all hidden state factors. This means we don't have to include many of the lagging dimensions in the likelihood tensors that correspond to hidden state factors that the observation modality in question doesn't depend on. The same goes for theB
arrays, which are already accordingly sparse due to the baked-in mean-field approximation of the posterior (statistical independence of hidden state factors in the prior).A
and one forB
), structured as follows:A_factor_list
, whereA_factor_list[m]
contains a list of the hidden state factor indices that correspond to the factors that observation modalitym
is conditionally dependent on.B_factor_list
whereB_factor_list[f]
is the list of hidden state factor indices that are needed to predict the dynamics of factorf
. For now we will assume control factors are still fully conditionally independent, such that oneB[f]
sub-array only depends on the control state factor with indexf
, even though it may depend on other hidden state factors.completing the above will also require building in the option of having additional dependencies in each factor-specific
B
array, on the other hidden state factors.