CatenateLayer
represents a net layer that takes a list of input tensors and catenates them.
represents a net layer that takes a list of input tensors and catenates them at level n.
Details and Options
- CatenateLayer[] is equivalent to CatenateLayer[1].
- CatenateLayer has a single input port that must be a list of tensors.
- Within a NetGraph, a CatenateLayer can be connected using a single edge of the form {src1,src2,…}catlayer, where catlayer is the name or index of the CatenateLayer, or as multiple separate edges given in the corresponding order, as src1->catlayer,…,src2catlayer,….
- CatenateLayer[…][{tensor1,tensor2,…}] explicitly computes the output given a list of tensori.
- CatenateLayer is typically used inside NetGraph.
- CatenateLayer exposes the following ports for use in NetGraph etc.:
-
"Input" a list of tensors "Output" a tensor - For a list of input tensors {tensor1,tensor2,…}, the tensori must be of compatible dimensions. If necessary, the tensori are replicated as appropriate in order to make them all the same rank.
- If given, the level n is relative to the first dimension of the tensori with smallest rank.
- When it cannot be inferred from other layers in a larger net, the option "Input"{shape1,shape2,…} can be used to fix the dimensions of the input tensors to CatenateLayer. Each shape shapei can be one of the following:
-
{d} ord a vector of dimensions d {d1,d2,…} a tensor of dimensions d1×d2×… {"Varying",…} a tensor with a varying initial dimension
Examples
open allclose allBasic Examples (3)
Create a CatenateLayer:
Create a CatenateLayer that takes two vectors as input and returns a vector:
Apply this layer to a list of vectors:
Construct a NetGraph with a CatenateLayer, specifying input sizes:
Scope (4)
Properties & Relations (1)
Possible Issues (4)
See Also
Related Guides
Introduced in 2016
(11.0)