Unable to compute gradient of loss of my model with sciml_train

I’m surprised that didn’t just error earlier. The issue is that you weren’t really passing p as it needed to be a keyword argument. That’s a deprecated function too, so the suggested updated syntax is:

function predict_adjoint(x, p) #we want to solve ivp with adjoint method
    _prob = remake(prob,u0=x,p=p)
          solve(_prob ,Tsit5(),  #[u0,0f0]
                   saveat=0f0:0.1f0:10f0,sensealg=DiffEqFlux.InterpolatingAdjoint(
                   checkpointing=true))
end
1 Like