# How do I pass Optim.Options(...) to DiffEqFlux.sciml\_train(...)

**URL:** https://discourse.julialang.org/t/how-do-i-pass-optim-options-to-diffeqflux-sciml-train/39127
**Category:** General Usage
**Tags:** question
**Created:** [May 8, 2020, 6:46pm UTC](https://discourse.julialang.org/t/how-do-i-pass-optim-options-to-diffeqflux-sciml-train/39127 "2020-05-08T18:46:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Matthew\_Overlin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/matthew_overlin/32/10533_2.png) [@Matthew\_Overlin](https://discourse.julialang.org/u/Matthew_Overlin)
#### Post date: [May 8, 2020, 6:46pm UTC](https://discourse.julialang.org/t/how-do-i-pass-optim-options-to-diffeqflux-sciml-train/39127/1 "2020-05-08T18:46:46Z")

</div>

I am using [DiffEqFlux](https://github.com/SciML/DiffEqFlux.jl/blob/master/README.md) to train neural ODEs. Following the example at this [link](https://julialang.org/blog/2019/01/fluxdiffeq/), I am using the function DiffEqFlux.scil\_train to train the neural network. I’d like to pass/customize some things with the optimizer. For example, I might like to specify f\_tol, f\_abstol, show\_trace. So, I might send “Optim.Options(f\_tol=1.0e-3, f\_abstol=1.0e-6, show\_trace=true)” as an argument to the “sciml\_train” function. What exactly would the syntax like if I want to do this? I’m trying to get a better fit with my data, so I want to pass in a low tolerance for f, so that the training completes with a lower loss than the loss it returns now.  
Thanks,  
Matt

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [May 10, 2020, 6:22am UTC](https://discourse.julialang.org/t/how-do-i-pass-optim-options-to-diffeqflux-sciml-train/39127/2 "2020-05-10T06:22:29Z")

</div>

Any extra keyword arguments get thrown down to Optim:

> <https://github.com/SciML/DiffEqFlux.jl/blob/master/src/train.jl#L271>

so you can just add `show_trace = true, f_tol = 1e-3`, etc.

Note that `sciml_train` ended up becoming a pretty big setup due to wrapping all of the Julia nonlinear optimization libraries we could find and throwing every reverse mode AD on it… so that’s all getting refactored out to [https://github.com/SciML/GalacticOptim.jl](https://github.com/SciML/GalacticOptim.jl) fairly soon. After it gets moved out and the API gets cleaned up for its role as a differentiable wrapper over optimization, we’ll make sure all of this gets proper documentation.
