tweak update rule

This commit is contained in:
Mike J Innes 2018-10-31 16:08:18 +00:00
parent 554c4c7c7a
commit 46049b9f44

View File

@ -3,14 +3,7 @@ using Base: depwarn
check_decay(opt, decay) = decay == 0 ? opt : Optimiser(opt, InvDecay(decay))
# legacy update rule
function updaterule(opt, ps)
() -> begin
for p in ps
delta = update!(opt, p.data, p.grad)
p.data .-= delta
end
end
end
updaterule(opt, ps) = () -> update!(p, ps)
function SGD(params::AbstractArray, η = 0.1; decay = 0.)
depwarn("SGD(params) is deprecated; use Descent(η::Float64) instead", :SGD)