AppendLayer

AppendLayer[]

represents a net layer that takes an input tensor and appends another tensor to it.

Details and Options

  • AppendLayer exposes the following ports for use in NetGraph etc.:
  • "Input"numerical tensor of rank n
    "Element"numerical tensor of rank n-1
  • AppendLayer is typically used inside NetGraph.
  • AppendLayer can operate on tensors that contain "Varying" dimensions.
  • AppendLayer[][<|"Input"in,"Element"elem|>] explicitly computes the output from applying the layer, which is effectively given by Append[in,elem].
  • AppendLayer[][<|"Input"->{in1,in2,},"Element"->{elem1,elem2,}|>] explicitly computes outputs for each of the ini and elemi.
  • AppendLayer[form,"port"->shape] allows the shape of the input or element port to be specified. Possible forms for shape are:
  • "Real"a single real number
    "Integer"a single integer
    na vector of length n
    {n1,n2,}a tensor of dimensions n1×n2×
    {"Varying",n2,n3,}a variable-length sequence of tensors of dimensions n2×n3×

Examples

open allclose all

Basic Examples  (2)

Create an AppendLayer:

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

Create an AppendLayer that takes a vector as input and appends a scalar:

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

Apply this layer to inputs:

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

Scope  (1)

See Also

Append  NetAppend  CatenateLayer  SequenceLastLayer  PartLayer  NetGraph

Tutorials

Introduced in 2018
(11.3)