Skip to content

Commit

Permalink
changed stable computation of 1/x
Browse files Browse the repository at this point in the history
  • Loading branch information
dimarkov committed Jul 12, 2024
1 parent 799581a commit 6d5b7f9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pymdp/jax/maths.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,8 @@ def spm_wnorm(A):
Returns Expectation of logarithm of Dirichlet parameters over a set of
Categorical distributions, stored in the columns of A.
"""
A = jnp.clip(A, min=MINVAL)
norm = 1. / A.sum(axis=0)
avg = 1. / A
avg = 1. / (A + MINVAL)
wA = norm - avg
return wA

Expand Down

0 comments on commit 6d5b7f9

Please sign in to comment.