You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are situations where I would like to call the optimizer explicitly, e.g. opt(params, grad) or update!(params, grad, opt). I think this could be achieved while maintaing modularity with e.g.
mutable struct Momentum
ρ
η
v
schedule
endfunction (m::Momentum)(g)
m.schedule(m)
@. m.v = m.ρ * m.v - m.η * g
endmutable struct SGD
η
momentum
schedule
endfunction (opt::SGD)(p, g)
opt.schedule(opt)
@. p -= opt.η * opt.momentum(g)
end
where schedule could be expdecay or invdecay.
What do you think?
The text was updated successfully, but these errors were encountered:
There are situations where I would like to call the optimizer explicitly, e.g.
opt(params, grad)
orupdate!(params, grad, opt)
. I think this could be achieved while maintaing modularity with e.g.where schedule could be expdecay or invdecay.
What do you think?
The text was updated successfully, but these errors were encountered: