Closed bob-carpenter closed 8 years ago
Hi!
Going over the function again, I think there is another bug, i.e. the function calls to
set_zero_all_adjoints();
should possibly be replaced with calls to
set_zero_all_adjoints_nested();
Right?
Sebastian
Either way will be OK, but the nested version will be more efficient (the stuff below the current nesting will already have all its adjoints set to zero because they're only nonzero in reverse sweeps).
On Feb 20, 2016, at 5:51 AM, wds15 notifications@github.com wrote:
Hi!
Going over the function again, I think there is another bug, i.e. the function calls to
set_zero_all_adjoints();
should possibly be replaced with calls to
set_zero_all_adjoints_nested();
Right?
Sebastian
— Reply to this email directly or view it on GitHub.
Hi Bob!
Let' start with smaller patches... I just fixed the problem described and pushed the branch
bugfix/issue-230-jacobian-transposed
Maybe you have a look and then we start a pull request?
Sebastian
@wds15, please create a pull request from that branch to develop. Thank you.
Sebastian Weber on stan-users pointed out that the matrix returned by the Jacobian functional in
math/rev/mat/functor/jacobian.hpp
returns a tranposed result.According to
https://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant
if
f: R^N -> R^M
, then the Jacobian should beM x N
But it's currently
N x M
.