add gradients in place
This commit is contained in:
parent
ddce04ea9d
commit
c4b96dbc98
@ -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