We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
prod
The (i,j)th element of the Hessian of y=prod(x) is y/x[i]/x[j] for i ≠ j and 0 for i==j, i.e. its diagonal is zero. However,
(i,j)
y=prod(x)
y/x[i]/x[j]
i ≠ j
i==j
julia> x = randn(3) 3-element Vector{Float64}: 0.11546090256645888 2.4121509171945448 -1.6103562544798857 julia> Tracker.hessian(prod, x) Tracked 3×3 Matrix{Float64}: 33.6428 0.0 0.0 0.0 0.0770819 0.0 0.0 0.0 0.172949
I believe this stems from the custom rule Tracker uses for prod.
The text was updated successfully, but these errors were encountered:
You mean this function? Seem to be correct.
@grad function prod(xs; dims=:) p = prod(data(xs); dims=dims) p, Δ -> (p ./ xs .* Δ,) end
Sorry, something went wrong.
No branches or pull requests
The
(i,j)
th element of the Hessian ofy=prod(x)
isy/x[i]/x[j]
fori ≠ j
and 0 fori==j
, i.e. its diagonal is zero. However,I believe this stems from the custom rule Tracker uses for
prod
.The text was updated successfully, but these errors were encountered: