fix train! API syntax docstring

This commit is contained in:
Dhairya Gandhi 2019-01-08 00:32:55 +05:30
parent eb287ae9a0
commit 7484c54f03

View File

@ -45,7 +45,7 @@ function stop()
end end
""" """
train!(model, loss, data, opt) train!(loss, params, data, opt; cb = () -> ())
For each datapoint `d` in `data` computes the gradient of `loss(d...)` through For each datapoint `d` in `data` computes the gradient of `loss(d...)` through
backpropagation and calls the optimizer `opt`. backpropagation and calls the optimizer `opt`.
@ -54,7 +54,7 @@ Takes a callback as keyword argument `cb`. For example, this will print "trainin
every 10 seconds: every 10 seconds:
```julia ```julia
Flux.train!(model, loss, data, opt, Flux.train!(loss, params, data, opt,
cb = throttle(() -> println("training"), 10)) cb = throttle(() -> println("training"), 10))
``` ```