You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been experimenting with computing higher order derivatives for recurrent models. For example, the following computes the gradient (with respect to model parameters) of the gradient of model's output (with respect to input data):
using Flux
functionf(i)
m =RNN(2, 2)
xs = [randn(Float32, 2, 2) for _ in1:i]
df() =gradient(b ->mapreduce(sum, +, m.(b)), xs)[1]
gradient(() ->mapreduce(sum, +, df()), Flux.params(m))
end
On my machine, for smaller values of i (1...15) it fails on Mutating arrays is not supported:
I've been experimenting with computing higher order derivatives for recurrent models. For example, the following computes the gradient (with respect to model parameters) of the gradient of model's output (with respect to input data):
On my machine, for smaller values of
i
(1...15
) it fails onMutating arrays is not supported
:which is kind of expected and can be remedied e.g. like this https://github.com/FluxML/Zygote.jl/pull/944/files.
For
i >= 16
, the following error happens:Is there any fix to that and is
Flux
framework for recurrent models built with nested AD in mind?The text was updated successfully, but these errors were encountered: