-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add generic SArray adjoint #65
Conversation
not quiet it seems. With the first definition of ApproxPeriodicKernel, I still get
The error references the line With the second definition, I get
Here, the error references the line |
Ah -- I should have caught that now with the latest commit.
Thinking about this a bit more, it's very odd, and definitely bad for performance, that you're getting a |
That's right and probably there is some performance problem with the first definition of ApproxPeriodicKernel. Since we will not go with this approach anyway, I would not try to dig into it too much. However, this simple example fails too: T = Float64
x = RegularSpacing(0.,0.01,1000)
k = OscillatorKernel{T,1}(T(1))
k = Matern32Kernel()
f = to_sde( GP(k), SArrayStorage(Float64) )
y = rand(f(x))
function objective(θ)
k = OscillatorKernel{T,1}(T(1))
f = to_sde( GP(k), SArrayStorage(Float64))
return -logpdf(f(x, θ), y)
end
Zygote.gradient(objective, .1)
Similarly, you would get an error with a Matern32Kernel if you comment out the adjoints for with Zygote.@adjoint function stationary_distribution(k::Matern32Kernel, storage_type)
return stationary_distribution(k, storage_type), Δ->(nothing, nothing)
end commented out, I get
|
Ahhh I see. I've made some more changes that I think should fix the problems you've been encountering -- the |
really nice! it all works now 👍
In those few cases when the Kernel does not crash, it references the line
and this happens even when I simplify to |
Great. I'll merge this once I've got the tests to pass. Regarding the list comprehensions, it's probably a Zygote thing. Could we take that conversation back to the periodic kernel issue, and could you provide a full stack trace? |
In principle, should resolve issues seen in #61 .
@andreaskoher could you confirm that it does so in your environment?