SequenceMostLayer

SequenceMostLayer[]

represents a net that takes a sequence of inputs and removes its last element.

Details and Options

  • SequenceMostLayer[] represents a net that takes a sequence of tensors and outputs a sequence of tensors of length one less than the input sequence length.
  • SequenceMostLayer[][input] explicitly computes the output from applying the layer.
  • SequenceMostLayer is typically used inside NetChain, NetGraph, etc.
  • The input and output ports of the net represented by SequenceMostLayer[] are:
  • "Input"a sequence of n tensors
    "Output"a sequence of n-1 tensors
  • SequenceMostLayer["Input"shape] allows the shape of the input to be specified. Possible forms for shape are:
  • na sequence of n numbers
    "Varying"a sequence of numbers of varying length
    {len,d1,d2,}sequence of len tensors of dimensions d1×d2×
    {"Varying",d1,d2,}varying number of tensors of dimensions d1×d2×

Examples

open allclose all

Basic Examples  (2)

Create a SequenceMostLayer:

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

Create a SequenceMostLayer that expects a sequence of vectors of size 3:

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

Apply the layer to a sequence:

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

Scope  (3)

Possible Issues  (2)

See Also

SequenceRestLayer  SequenceLastLayer  SequenceReverseLayer  NetMapOperator  BasicRecurrentLayer

Introduced in 2017
(11.1)