remove old code
This commit is contained in:
parent
b35f50571c
commit
af30ee78d2
18
src/model.jl
18
src/model.jl
@ -60,9 +60,9 @@ function runmodel end
|
|||||||
|
|
||||||
# TODO: should be AbstractArray?
|
# TODO: should be AbstractArray?
|
||||||
"""
|
"""
|
||||||
A `Param` object stores a parameter array along with an accumulated delta to
|
A `Param` object stores a parameter array along with its gradient.
|
||||||
that array. When converting to backends like TensorFlow, identical `Param`s will
|
When converting to backends like TensorFlow, identical `Param`s will
|
||||||
result in identical variable objects, making model reuse trivial.
|
result in identical variable objects.
|
||||||
"""
|
"""
|
||||||
struct Param{T}
|
struct Param{T}
|
||||||
x::T
|
x::T
|
||||||
@ -78,17 +78,6 @@ param(x) = Param(x, zero(x))
|
|||||||
|
|
||||||
state(p::Param) = p.x
|
state(p::Param) = p.x
|
||||||
|
|
||||||
"""
|
|
||||||
accumulate!(p::Param, Δ) => p
|
|
||||||
|
|
||||||
Accumulates the update `Δ` on `p`. The value of `p` won't change until
|
|
||||||
`update!`.
|
|
||||||
"""
|
|
||||||
function accumulate!(p::Param, Δ)
|
|
||||||
p.Δx += Δ
|
|
||||||
return p
|
|
||||||
end
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
update!(p::Param)
|
update!(p::Param)
|
||||||
|
|
||||||
@ -101,7 +90,6 @@ function update!(p::Param, η)
|
|||||||
end
|
end
|
||||||
|
|
||||||
state(x) = x
|
state(x) = x
|
||||||
accumulate!(x, Δ) = x
|
|
||||||
|
|
||||||
Base.size(p::Param) = size(p.x)
|
Base.size(p::Param) = size(p.x)
|
||||||
Base.size(p::Param, n) = size(p.x, n)
|
Base.size(p::Param, n) = size(p.x, n)
|
||||||
|
Loading…
Reference in New Issue
Block a user