Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add step! #1833

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
5 changes: 3 additions & 2 deletions src/optimise/train.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Juno
import Zygote: Params, gradient
import Zygote: Params, withgradient

"""
update!(x, x̄)
Expand Down Expand Up @@ -102,8 +102,9 @@ for d in data

"""
function step!(loss, params, opt)
gs = gradient(loss, params)
val, gs = withgradient(loss, params)
darsnack marked this conversation as resolved.
Show resolved Hide resolved
update!(opt, params, gs)
return val, gs
end

"""
Expand Down