Skip to content

Commit

Permalink
turn action into integer when indexing into slices of B array in `upd…
Browse files Browse the repository at this point in the history
…ate_state_likelihood_dirichlet()`, to avoid improper index error
  • Loading branch information
conorheins committed Apr 1, 2022
1 parent ea83bca commit fcf1152
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymdp/learning.py
Expand Up @@ -100,7 +100,7 @@ def update_state_likelihood_dirichlet(

for factor in factors:
dfdb = maths.spm_cross(qs[factor], qs_prev[factor])
dfdb *= (B[factor][:, :, actions[factor]] > 0).astype("float")
dfdb *= (B[factor][:, :, int(actions[factor])] > 0).astype("float")
qB[factor][:,:,int(actions[factor])] += (lr*dfdb)

return qB
Expand Down

0 comments on commit fcf1152

Please sign in to comment.