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