iterate over chain
This commit is contained in:
parent
2a57150bce
commit
06f2ee2284
@ -21,6 +21,7 @@ type Chain <: Model
|
|||||||
end
|
end
|
||||||
|
|
||||||
@forward Chain.layers Base.getindex, Base.first, Base.last, Base.endof
|
@forward Chain.layers Base.getindex, Base.first, Base.last, Base.endof
|
||||||
|
@forward Chain.layers Base.start, Base.next, Base.done
|
||||||
|
|
||||||
(s::Chain)(x) = foldl((x, m) -> m(x), x, s.layers)
|
(s::Chain)(x) = foldl((x, m) -> m(x), x, s.layers)
|
||||||
back!(s::Chain, Δ) = foldr((m, Δ) -> back!(m, Δ), Δ, s.layers)
|
back!(s::Chain, Δ) = foldr((m, Δ) -> back!(m, Δ), Δ, s.layers)
|
||||||
|
Loading…
Reference in New Issue
Block a user