Say I have a model m = Dense(1,1)
, a function f(x) = x
, and a loss(a,b,c) = m(a) - b - f(c)
.
I don’t want zygote to differentiate on f(c)
when calling gradient(() -> loss(a,b,c), m)
. How do I tell it that ? It is a problem because the function f is generating random numbers and I get weird errors like Abstract type AbstractFloat does not have a definite size.
.