Copyright | (c) Huw Campbell 2016-2017 |
---|---|
License | BSD2 |
Stability | experimental |
Safe Haskell | None |
Language | Haskell98 |
This module provides the concatenation layer, which runs two chilld layers in parallel and combines their outputs.
Documentation
data Concat :: Shape -> * -> Shape -> * -> * where Source #
A Concatentating Layer.
This layer shares it's input state between two sublayers, and concatenates their output.
With Networks able to be Layers, this allows for very expressive composition of complex Networks.
The Concat layer has a few instances, which allow one to flexibly "bash" together the outputs.
Two 1D vectors, can go to a 2D shape with 2 rows if their lengths are identical. Any 2 1D vectors can also become a longer 1D Vector.
3D images become 3D images with more channels. The sizes must be the same, one can use Pad and Crop layers to ensure this is the case.
(Show x, Show y) => Show (Concat m x n y) Source # | |
(Serialize a, Serialize b) => Serialize (Concat sa a sb b) Source # | |
(UpdateLayer x, UpdateLayer y) => UpdateLayer (Concat m x n y) Source # | Run two layers in parallel, combining their outputs. |
(SingI Shape i, Layer x i (D1 m), Layer y i (D1 n), KnownNat o, KnownNat m, KnownNat n, (~) Nat o ((+) m n), (~) Nat n ((-) o m), (~) Bool ((<=?) m o) True) => Layer (Concat (D1 m) x (D1 n) y) i (D1 o) Source # | |
(SingI Shape i, Layer x i (D1 o), Layer y i (D1 o)) => Layer (Concat (D1 o) x (D1 o) y) i (D2 2 o) Source # | |
(SingI Shape i, Layer x i (D3 rows cols m), Layer y i (D3 rows cols n), KnownNat (* rows n), KnownNat (* rows m), KnownNat (* rows o), KnownNat o, KnownNat m, KnownNat n, (~) Nat ((+) (* rows m) (* rows n)) (* rows o), (~) Nat ((-) (* rows o) (* rows m)) (* rows n), (~) Bool ((<=?) (* rows m) (* rows o)) True) => Layer (Concat (D3 rows cols m) x (D3 rows cols n) y) i (D3 rows cols o) Source # | Concat 3D shapes, increasing the number of channels. |
type Gradient (Concat m x n y) Source # | |
type Tape (Concat (D1 m) x (D1 n) y) i (D1 o) Source # | |
type Tape (Concat (D1 o) x (D1 o) y) i (D2 2 o) Source # | |
type Tape (Concat (D3 rows cols m) x (D3 rows cols n) y) i (D3 rows cols o) Source # | |