-
Notifications
You must be signed in to change notification settings - Fork 32
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
Tests using Flux.Tracker #21
Comments
Running the following code... function f_test(θᴿ, x)
K = 3
μ = [0.5, 0.2, -0.5]
@assert length(θᴿ) == K
logpdf_mm(θ, x) = log(sum(θ .* (x.-μ).^2))
d = Dirichlet(K, 1.0)
lp = logpdf_with_trans(d, invlink(d, θᴿ), true)
lp += logpdf_mm(invlink(d, θᴿ), x)
return lp
end
v, g = Tracker.forward((θ, x) -> f_test(θ, x), [0.3, 0.2, 0.5], 0.4) will result in: MethodError: no method matching Float64(::Flux.Tracker.TrackedReal{Float64})
Closest candidates are:
Float64(::Real, !Matched::RoundingMode) where T<:AbstractFloat at rounding.jl:185
Float64(::T<:Number) where T<:Number at boot.jl:725
Float64(!Matched::Int8) at float.jl:60
... |
This issue is related to the fact that
|
If instead an Array of |
This is fixed now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We should add test which test agains the use of
Flux.Tracker
for AD. While playing around with the transformations I encountered some issues while usingFlux.Tracker
and simplex distributions.The text was updated successfully, but these errors were encountered: