52
52
# only slightly changed to better handle interaction with Zygote @dsweber2
53
53
"""
54
54
activations(c::Chain, input)
55
+
55
56
Calculate the forward results of each layers in Chain `c` with `input` as model input.
56
57
"""
57
58
function activations (c:: Chain , input)
@@ -100,7 +101,7 @@ julia> d1 = Dense(ones(2, 5), false, tanh) # using provided weight matrix
100
101
Dense(5, 2, tanh; bias=false)
101
102
102
103
julia> d1(ones(5))
103
- 2-element Array {Float64,1 }:
104
+ 2-element Vector {Float64}:
104
105
0.9999092042625951
105
106
0.9999092042625951
106
107
@@ -384,6 +385,7 @@ Called with one input `x`, this is equivalent to `reduce(connection, [l(x) for l
384
385
If called with multiple inputs, they are `zip`ped with the layers, thus `Parallel(+, f, g)(x, y) = f(x) + g(y)`.
385
386
386
387
# Examples
388
+
387
389
```jldoctest
388
390
julia> model = Chain(Dense(3, 5),
389
391
Parallel(vcat, Dense(5, 4), Chain(Dense(5, 7), Dense(7, 4))),
@@ -394,6 +396,7 @@ julia> size(model(rand(3)))
394
396
395
397
julia> model = Parallel(+, Dense(10, 2), Dense(5, 2))
396
398
Parallel(+, Dense(10, 2), Dense(5, 2))
399
+
397
400
julia> size(model(rand(10), rand(5)))
398
401
(2,)
399
402
```
0 commit comments