update cleanup
This commit is contained in:
parent
447fd9d604
commit
6c67404398
@ -7,14 +7,12 @@ function update!(x::AbstractArray, x̄)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function update!(opt, x, x̄)
|
function update!(opt, x, x̄)
|
||||||
if x̄ == nothing
|
x .-= apply!(opt, x, x̄)
|
||||||
x̄ = zeros(size(x)...)
|
|
||||||
end
|
|
||||||
update!(x, -apply!(opt, x, x̄))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function update!(opt, xs::Params, gs)
|
function update!(opt, xs::Params, gs)
|
||||||
for x in xs
|
for x in xs
|
||||||
|
gs[x] == nothing && continue
|
||||||
update!(opt, x, gs[x])
|
update!(opt, x, gs[x])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -25,6 +23,7 @@ runall(f) = f
|
|||||||
runall(fs::AbstractVector) = () -> foreach(call, fs)
|
runall(fs::AbstractVector) = () -> foreach(call, fs)
|
||||||
|
|
||||||
struct StopException <: Exception end
|
struct StopException <: Exception end
|
||||||
|
|
||||||
"""
|
"""
|
||||||
stop()
|
stop()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user