Currently when setting up a model using labels, it is not possible to set up both A and B matrix stubs from the same labels dictionary, due to the implied absence/presence of the actions key.
This isn't a great user experience - ideally someone should be able to specify all the labels in a single variable, and then generate all constituent parts of the model from that.
raises the following error from create_A_matrix_stub():
File "/home/arunn/repos/pymdp-cookbook/venv/lib/python3.11/site-packages/pymdp/utils.py", line 457, in create_A_matrix_stub
num_obs, _, num_states, _= get_model_dimensions_from_labels(model_labels)
^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 4)
This change:
adds a Dimensions object to be returned when getting dimensions from labels. as 6 return values is a bit messy
ignores dimensions related to actions when creating an A matrix
adds a new unit test for Dimensions and updates the existing one for the create_A_matrix_stub()
Currently when setting up a model using labels, it is not possible to set up both A and B matrix stubs from the same labels dictionary, due to the implied absence/presence of the
actions
key.This isn't a great user experience - ideally someone should be able to specify all the labels in a single variable, and then generate all constituent parts of the model from that.
E.g. the following label spec:
raises the following error from
create_A_matrix_stub()
:This change:
create_A_matrix_stub()