Closed a1ix2 closed 5 months ago
Yes, thanks for the report. The change to state makes it so the direct translation is:
function cb(state, l)
@info "FFJORD Training" loss=loss(state.u)
return false
end
But of course as you found, the better thing is just to use the pre-computed l
:
function cb(state, l)
@info "FFJORD Training" loss=l
return false
end
This is fixed in https://github.com/SciML/DiffEqFlux.jl/commit/2691d5915a6c20613905ca257208695e642af09e
The copy-pasteable FFJORD example here doesn't quite work as is.
I copy-pasted the code in a brand new
--temp
environment (only change ismaxiter=1
) and get an errorThe problem appears to be in the callback function. I don't quite understand why it doesn't work as-is, but simply replacing
loss=loss(p)
byloss=l
does the trick.