SequenceReverseLayer

SequenceReverseLayer[]

represents a net that reverses the order of an input sequence.

Details and Options

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

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

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

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

Apply the layer to a sequence of vectors:

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

Scope  (3)

Applications  (1)

Possible Issues  (1)

See Also

SequenceMostLayer  SequenceRestLayer  SequenceLastLayer  NetMapOperator  BasicRecurrentLayer

Introduced in 2017
(11.1)