5252# only slightly changed to better handle interaction with Zygote @dsweber2
5353"""
5454 activations(c::Chain, input)
55+
5556Calculate the forward results of each layers in Chain `c` with `input` as model input.
5657"""
5758function activations(c:: Chain , input)
@@ -100,7 +101,7 @@ julia> d1 = Dense(ones(2, 5), false, tanh) # using provided weight matrix
100101Dense(5, 2, tanh; bias=false)
101102
102103julia> d1(ones(5))
103- 2-element Array {Float64,1 }:
104+ 2-element Vector {Float64}:
104105 0.9999092042625951
105106 0.9999092042625951
106107
@@ -384,6 +385,7 @@ Called with one input `x`, this is equivalent to `reduce(connection, [l(x) for l
384385If called with multiple inputs, they are `zip`ped with the layers, thus `Parallel(+, f, g)(x, y) = f(x) + g(y)`.
385386
386387# Examples
388+
387389```jldoctest
388390julia> model = Chain(Dense(3, 5),
389391 Parallel(vcat, Dense(5, 4), Chain(Dense(5, 7), Dense(7, 4))),
@@ -394,6 +396,7 @@ julia> size(model(rand(3)))
394396
395397julia> model = Parallel(+, Dense(10, 2), Dense(5, 2))
396398Parallel(+, Dense(10, 2), Dense(5, 2))
399+
397400julia> size(model(rand(10), rand(5)))
398401(2,)
399402```
0 commit comments