add gradients in place
This commit is contained in:
parent
77e97dfc8b
commit
9b095a874b
@ -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
Block a user