Skip to content

Commit d0cf342

Browse files
committed
Switch to update! only
1 parent 341144d commit d0cf342

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/optimise/Optimise.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Zygote
66
import Zygote: Params, gradient
77
using AbstractDifferentiation
88
import Optimisers
9-
import Optimisers: update, update!
9+
import Optimisers: update!
1010
using LinearAlgebra
1111
import ArrayInterface
1212
using ProgressLogging: @progress, @withprogress, @logprogress

src/optimise/train.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ function Optimisers.update!(opt::AbstractOptimiser, xs::Params, gs)
2424

2525
return opt, xs
2626
end
27-
Optimisers.update(opt::AbstractOptimiser, xs::Params, gs) = update!(opt, xs, gs)
2827

2928
# Callback niceties
3029
call(f, xs...) = f(xs...)
@@ -144,7 +143,7 @@ function train!(loss, ad::AD.AbstractBackend, model, data, optstate; cb = () ->
144143
if !isfinite(l)
145144
throw(DomainError("Loss is $l on data item $i, stopping training"))
146145
end
147-
optstate, model = update(optstate, model, _gradient_only(gs))
146+
optstate, model = update!(optstate, model, _gradient_only(gs))
148147
cb()
149148
catch ex
150149
if ex isa StopException

0 commit comments

Comments
 (0)