Skip to content

Commit 8e2e840

Browse files
More doc tweaks
Co-authored-by: Michael Abbott <[email protected]>
1 parent 121b898 commit 8e2e840

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/layers/basic.jl

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -532,31 +532,30 @@ end
532532
533533
This layer behaves differently based on input type:
534534
535-
1. Input `x` is a tuple of length `N`. Then `layers` must be a tuple of length `N`.
536-
537-
With 3 layers, it takes 3 inputs and returns 3 outputs.
538-
`(y1, y2, y3) = PairwiseFusion(connection, layer1, layer2, layer3)((x1, x2, x3))`
539-
may be drawn as:
535+
1. If input `x` is a tuple of length `N`, matching the number of `layers`,
536+
then each layer receives a new input `x[i]` combined with the previous output `y[i-1]` using `connection`.
537+
Thus `(y1, y2, y3) = PairwiseFusion(connection, layer1, layer2, layer3)((x1, x2, x3))`
538+
may be drawn as:
540539
```
541540
x1 → layer1 → y1 ↘
542541
connection → layer2 → y2 ↘
543542
x2 ↗ connection → layer3 → y3
544543
x3 ↗
545544
```
546-
547-
In code:
545+
... or written as:
548546
```julia
549547
y1 = layer1(x1)
550548
y2 = layer2(connection(x2, y1))
551549
y3 = layer3(connection(x3, y2))
552550
```
553551
554-
2. Any other kind of input:
552+
2. With just one input, each layer receives the same `x` combined with the previous output.
553+
Thus `y = PairwiseFusion(connection, layers...)(x)` obeys:
555554
556555
```julia
557-
y₁ = x
558-
for i in 1:N
559-
yᵢ₊₁ = connection(x, layers[i](yᵢ))
556+
y[1] == layers[1](x)
557+
for i in 2:length(layers)
558+
y[i] == connection(x, layers[i](y[i-1]))
560559
end
561560
```
562561

0 commit comments

Comments
 (0)