CatenateLayer

CatenateLayer[]

represents a net layer that takes a list of input arrays and catenates them.

CatenateLayer[n]

represents a net layer that takes a list of input arrays and catenates them at level n.

Details and Options

  • CatenateLayer[] is equivalent to CatenateLayer[1].
  • CatenateLayer is typically used inside NetGraph.
  • CatenateLayer has an arbitrary number of input ports named 1, 2, etc.
  • 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 src1catlayer,src2catlayer,,srcncatlayer.
  • CatenateLayer[][{array1,array2,}] explicitly computes the output given a list of arrayi.
  • When given a NumericArray as input, the output will be a NumericArray.
  • CatenateLayer exposes the following ports for use in NetGraph etc.:
  • 1,2,arrays
    "Output"an array
  • For a list of input arrays {array1,array2,}, the arrayi must be of compatible dimensions. If necessary, the arrayi 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 arrayi with smallest rank.
  • When it cannot be inferred from other layers in a larger net, the option "Inputs"{shape1,shape2,} can be used to fix the dimensions of the input arrays to CatenateLayer. Each shape shapei can be one of the following:
  • {n} orna vector of dimensions n
    {n1,n2,}an array of dimensions n1×n2×
    {"Varying",n2,n3,}an array whose first dimension is variable and whose remaining dimensions are n2×n3×

Examples

open all close all

Basic Examples  (3)

Create a CatenateLayer:

In[1]:=
Click for copyable input
Out[1]=

Create a CatenateLayer that takes two vectors as input and returns a vector:

In[1]:=
Click for copyable input
Out[1]=

Apply this layer to a list of vectors:

In[2]:=
Click for copyable input
Out[2]=

Construct a NetGraph with a CatenateLayer, specifying input sizes:

In[1]:=
Click for copyable input
Out[1]=

Apply the net to input data:

In[2]:=
Click for copyable input
Out[2]=

Scope  (4)

Properties & Relations  (1)

Possible Issues  (4)

Introduced in 2016
(11.0)
|
Updated in 2018
(11.3)