tweaks
This commit is contained in:
parent
20b13b9a41
commit
545d4480ed
@ -6,7 +6,6 @@ end
|
|||||||
param(x) = Param(x, zero(x))
|
param(x) = Param(x, zero(x))
|
||||||
|
|
||||||
state(p::Param) = p.x
|
state(p::Param) = p.x
|
||||||
state(x) = x
|
|
||||||
|
|
||||||
function accumulate!(p::Param, Δ)
|
function accumulate!(p::Param, Δ)
|
||||||
p.Δx .+= Δ
|
p.Δx .+= Δ
|
||||||
@ -14,8 +13,9 @@ function accumulate!(p::Param, Δ)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function update!(p::Param, η)
|
function update!(p::Param, η)
|
||||||
p.x .+= p.Δx * η
|
p.x .+= p.Δx .* η
|
||||||
return p
|
return p
|
||||||
end
|
end
|
||||||
|
|
||||||
|
state(x) = x
|
||||||
accumulate!(x, Δ) = x
|
accumulate!(x, Δ) = x
|
||||||
|
Loading…
Reference in New Issue
Block a user