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 arrays and outputs a sequence of arrays of length one less than the input sequence length.
  • SequenceRestLayer[][input] explicitly computes the output from applying the layer.
  • SequenceRestLayer[][{input1,input2,}] explicitly computes an output for each of the inputi.
  • When given a NumericArray as input, the output will be a NumericArray.
  • 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 arrays
    "Output"a sequence of n-1 arrays
  • 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 arrays of dimensions d1×d2×
    {"Varying",d1,d2,}varying number of arrays of dimensions d1×d2×
  • Options[SequenceRestLayer] gives the list of default options to construct the layer. Options[SequenceRestLayer[]] gives the list of default options to evaluate the layer on some data.
  • Information[SequenceRestLayer[]] gives a report about the layer.
  • Information[SequenceRestLayer[],prop] gives the value of the property prop of SequenceRestLayer[]. Possible properties are the same as for NetGraph.

Examples

open allclose all

Basic Examples  (2)

Create a SequenceRestLayer:

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

Apply the layer to a sequence:

Scope  (3)

Create a SequenceRestLayer that expects a length-3 sequence of 2x2 matrices:

Apply the layer to a sequence:

Create a SequenceRestLayer that expects a sequence of real numbers:

Thread the layer across a batch of inputs:

Create a SequenceRestLayer that drops the first color channel from an RGB image, turning it into a two-channel image:

Apply it to an image:

Possible Issues  (2)

SequenceRestLayer cannot be applied to sequences of length less than 2:

SequenceRestLayer cannot accept symbolic inputs:

Introduced in 2017
 (11.1)