Last active
April 23, 2020 13:57
-
-
Save khannay/db7cc24699ec4ac972d5d2d1b23253c4 to your computer and use it in GitHub Desktop.
Lotka_volterra fitting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function train_model(;pguess=[0.8,1.2,1.2,1.0,2.9,1.1]) | |
println("The initial loss function is $(loss_adjoint(pguess)[1])") | |
#Train the ODE | |
resinit=DiffEqFlux.sciml_train(loss_adjoint,pguess,ADAM(), maxiters=3000) | |
res = DiffEqFlux.sciml_train(loss_adjoint,resinit.minimizer,BFGS(initial_stepnorm = 1e-5)) | |
println("The parameters are $(res.minimizer) with final loss value $(res.minimum)") | |
return(res) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment