-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove jax from import #169
base: v1.0.0_alpha
Are you sure you want to change the base?
Conversation
Yup, good catch ... |
See my comment above on the policy entropy function -- we avoid evaluating log of 0.0 within the the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you replace that call to jnp.log(node["q_pi"] + 1e-16) with the stablelog
call?
@@ -269,7 +269,7 @@ def tree_backward(node, prune_penalty=512, gamma=1): | |||
|
|||
|
|||
def policy_entropy(node): | |||
return -jnp.dot(node["q_pi"], jnp.log(node["q_pi"] + pymdp.maths.EPS_VAL)) | |||
return -jnp.dot(node["q_pi"], jnp.log(node["q_pi"] + 1e-16)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be fixable by simply doing
-jnp.dot(node["q_pi"], pymdp.maths.stablelog(node["q_pi"]))`
or even
-pymdp.maths.stable_xlogx(node["q_pi"]).sum()
si.py
was still refering to thepymdp.jax.control
version ofcontrol.py
breaking imports of sophisticated inference. Also removes unused imports.