Skip to content

Commit

Permalink
fix max
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Verbelen committed May 3, 2024
1 parent 9e5c366 commit a9874f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymdp/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ def calc_inductive_cost(qs, qs_pi, I, epsilon=1e-3):
m = np.where(I[factor][:, idx] == 1)[0]
# we might find no path to goal (i.e. when no goal specified)
if len(m) > 0:
m = np.max(m[0]-1, 0)
m = max(m[0]-1, 0)
I_m = (1-I[factor][m, :]) * np.log(epsilon)
inductive_cost += I_m.dot(qs_pi[t][factor])

Expand Down

0 comments on commit a9874f1

Please sign in to comment.