-
Notifications
You must be signed in to change notification settings - Fork 91
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
einsum while calculating free energy #98
Comments
Hi @lqiang2003cn , Thanks for noticing this, and many apologies for the late reply! I think you're absolutely right about this -- I will look into this and fix, but feel free to submit a PR / your own fix if you'd like. I'm imagining the solution would be to do exactly what you're saying, namely:
But I'm debating whether to make that an additional gating condition within An aside: |
spm_dot is already complex enough (for me), i'd |
…y in `maths.calc_free_energy`, thanks to spotting by @lqiang2003cn, see #98 here: #98
Fixing variational free energy calculation bug in `pymdp.maths`, to address #98
I fixed the bug, and have merged the resulting PR into master. Nice job again @lqiang2003cn for spotting this, and thank you. This is by far the most technically-nuanced error someone has noticed so far; I'm impressed that you managed to parse that line of preparation for the einsum arguments in Will close this issue upon release of pymdp |
Closing now that v0.0.7 is released |
hi, guys, i have a question about calculating the free energy. While calculating einsum, why only sum to the first dim:
arg_list = [X, list(range(X.ndim))] + list(chain(*([x[xdim_i],[dims[xdim_i]]] for xdim_i in range(len(x))))) + [[0]]
and then use:
spm_dot(likelihood, qs)[0]
to fetch only the first level of s0 (suppose hidden state s is factorized as s0, s1, ... ) ?
in my opinion, we should sum over all the tensor by removing the last + [[0]] and the Y should just be a scalar.
am I totally wrong, if i am, please correct me, thanks a lot!
The text was updated successfully, but these errors were encountered: