add gradients in place
This commit is contained in:
parent
ddce04ea9d
commit
c4b96dbc98
|
@ -9,12 +9,12 @@ state(p::Param) = p
|
|||
state(x) = x
|
||||
|
||||
function accumulate!(p::Param, Δ)
|
||||
p.Δx += Δ
|
||||
p.Δx .+= Δ
|
||||
return p
|
||||
end
|
||||
|
||||
function update!(p::Param, η)
|
||||
p.x += p.Δx * η
|
||||
p.x .+= p.Δx * η
|
||||
return p
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue