@@ -532,31 +532,30 @@ end
532532
533533This 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```
541540x1 → layer1 → y1 ↘
542541 connection → layer2 → y2 ↘
543542 x2 ↗ connection → layer3 → y3
544543 x3 ↗
545544```
546-
547- In code:
545+ ... or written as:
548546```julia
549547y1 = layer1(x1)
550548y2 = layer2(connection(x2, y1))
551549y3 = 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] ))
560559end
561560```
562561
0 commit comments