SequenceRestLayer

SequenceRestLayer[]

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

Details and Options

  • SequenceRestLayer[] represents a net that takes a sequence of tensors and outputs a sequence of tensors of length one less than the input sequence length.
  • SequenceRestLayer[][input] explicitly computes the output from applying the layer.
  • SequenceRestLayer is typically used inside NetChain, NetGraph, etc.
  • The input and output ports of the net represented by SequenceRestLayer[] are:
  • "Input"a sequence of n tensors
    "Output"a sequence of n-1 tensors
  • SequenceRestLayer["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 SequenceRestLayer:

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

Create a SequenceRestLayer 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

SequenceMostLayer  SequenceLastLayer  SequenceReverseLayer  NetMapOperator  BasicRecurrentLayer

Introduced in 2017
(11.1)