# Two questions on Flux

**URL:** <https://discourse.julialang.org/t/two-questions-on-flux/22307>\
**Category:** Machine Learning\
**Created:** [March 25, 2019, 3:21pm UTC](https://discourse.julialang.org/t/two-questions-on-flux/22307 "2019-03-25T15:21:18Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [July 1, 2019, 9:50am UTC](https://discourse.julialang.org/t/two-questions-on-flux/22307/22 "2019-07-01T09:50:32Z")

</div>

For those still interested in using BFGS (or L-BFGS) to train flux models, I made a small utility package to facilitate this

> [@\[ANN\] FluxOptTools](https://discourse.julialang.org/t/ann-fluxopttools/25888):
>
> [FluxOptTools.jl](https://github.com/baggepinnen/FluxOptTools.jl) This package contains some utilities to enhance training of [Flux.jl](https://github.com/FluxML/Flux.jl) models. Train using Optim [Optim.jl](https://github.com/JuliaNLSolvers/Optim.jl) can be used to train Flux models (if Flux is on branch sf/zygote\_updated), here’s an example how using Flux, Zygote, Optim, FluxOptTools, Statistics m = Chain(Dense(1,3,tanh) , Dense(3,1)) x = LinRange(-pi,pi,100)' y = sin.(x) loss() = mean(abs2, m(x) .- y) Zygote.refresh() pars = Flux.params(m) lossfun, gradfun, fg!, p0 = optfuns(loss, pars) res = Optim.opti…

---

_[View the full topic](https://discourse.julialang.org/t/two-questions-on-flux/22307)._
