Flux is an elegant approach to machine learning. It's a 100% pure-Julia stack, and provides lightweight abstractions on top of Julia's native GPU and AD support. Flux makes the easy things easy while remaining fully hackable.
Works best with Julia 1.8 or later. Here's a very short example to try it out:
using Flux, Plots data = [([x], 2x-x^3) for x in -2:0.1f0:2] model = Chain(Dense(1 => 23, tanh), Dense(23 => 1, bias=false), only) optim = Flux.setup(Adam(), model) for epoch in 1:1000 Flux.train!((m,x,y) -> (m(x) - y)^2, model, data, optim) end plot(x -> 2x-x^3, -2, 2, legend=false) scatter!(x -> model([x]), -2:0.1f0:2)
If you use Flux in your research, please cite our work.