Hi,
I am beginner in Julia and I would like to use Flux. I tried to do the following:
using Flux
NN = Chain(Dense(1, 5, σ), Dense(5, 1, σ))
model(x) = NN([x])[1];
df(x) = gradient(model, x)[1]
function lossEq(x)
(df(x) - 2.0 * x - 3)^2
end
gs = gradient(() -> lossEq(0.2), params(NN))
But the following error is raised:
ERROR: Can't differentiate foreigncall expression
Is it actually possible to compute such a gradient that involves a gradient ?
Best,
Lucas