Chain activations

This commit is contained in:
Mike J Innes 2018-06-26 14:30:46 +01:00
parent 4d7548b7a3
commit 0a04e3ba61

View File

@ -38,6 +38,11 @@ function Base.show(io::IO, c::Chain)
print(io, ")") print(io, ")")
end end
# Seem to need this for `accumulate`; try removing on 0.7
Base.rcum_promote_type(op, ::Type, ::Type{Any}) = Any
activations(c::Chain, x) = accumulate((x, m) -> m(x), x, c.layers)
""" """
Dense(in::Integer, out::Integer, σ = identity) Dense(in::Integer, out::Integer, σ = identity)