AppendLayer

AppendLayer[]

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

Details and Options

  • AppendLayer exposes the following input ports for use in NetGraph etc.:
  • "Input"an array of rank n
    "Element"an array of rank n-1
  • AppendLayer exposes the output port "Output", which is an array of rank n.
  • AppendLayer is typically used inside NetGraph.
  • AppendLayer can operate on arrays 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"{element1,element2,}|>] explicitly computes outputs for each of the ini and elementi.
  • When given a NumericArray as input, the output will be a NumericArray.
  • AppendLayer["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,}an array of dimensions n1×n2×
    {"Varying",n2,n3,}an array whose first dimension is variable and remaining dimensions are n2×n3×

Examples

open all close 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)

Introduced in 2018
(11.3)