add gradients in place

This commit is contained in:
Mike J Innes 2016-08-23 15:03:06 +01:00
parent ddce04ea9d
commit c4b96dbc98
1 changed files with 2 additions and 2 deletions

View File

@ -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