represents a net that takes a sequence of inputs and removes its last element.
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 arrays and outputs a sequence of arrays of length one less than the input sequence length.
- SequenceMostLayer[…][input] explicitly computes the output NumericArray object from applying the layer.
- SequenceMostLayer[…][{input1,input2,…}] explicitly computes an output for each of the inputi.
- When given a NumericArray as input, the output will be a NumericArray.
- 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 arrays "Output" a sequence of n-1 arrays - SequenceMostLayer["Input"shape] allows the shape of the input to be specified. Possible forms for shape are:
-
n a 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[SequenceMostLayer] gives the list of default options to construct the layer. Options[SequenceMostLayer[…]] gives the list of default options to evaluate the layer on some data.
- Information[SequenceMostLayer[…]] gives a report about the layer.
- Information[SequenceMostLayer[…],prop] gives the value of the property prop of SequenceMostLayer[…]. Possible properties are the same as for NetGraph.
Examples
open all close allBasic Examples (2)
Create a SequenceMostLayer:
SequenceMostLayer[]Create a SequenceMostLayer that expects a sequence of vectors of size 3:
most = SequenceMostLayer["Input" -> {"Varying", 3}]Apply the layer to a sequence:
most[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}]Scope (3)
Ports (3)
Create a SequenceMostLayer that expects a length-3 sequence of 2x2 matrices:
most = SequenceMostLayer["Input" -> {3, 2, 2}]Apply the layer to a sequence:
most[{{{1, 2}, {4, 5}}, {{7, 8}, {10, 11}}, {{12, 13}, {14, 15}}}]Create a SequenceMostLayer that expects a sequence of real numbers:
most = SequenceMostLayer["Input" -> "Varying"]Thread the layer across a batch of inputs:
most[{{1, 2, 3}, {4, 5}, {6, 7, 8, 9}}]Create a SequenceMostLayer that drops the last color channel from an RGB image, turning it into a two-channel image:
most = SequenceMostLayer["Input" -> NetEncoder["Image"], "Output" -> NetDecoder["Image"]]most[[image]]Possible Issues (1)
SequenceMostLayer cannot accept symbolic inputs:
most = SequenceMostLayer[];
most[{1, 2}]most[{1, z}]Tech Notes
Related Guides
History
Text
Wolfram Research (2017), SequenceMostLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/SequenceMostLayer.html.
CMS
Wolfram Language. 2017. "SequenceMostLayer." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SequenceMostLayer.html.
APA
Wolfram Language. (2017). SequenceMostLayer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SequenceMostLayer.html
BibTeX
@misc{reference.wolfram_2026_sequencemostlayer, author="Wolfram Research", title="{SequenceMostLayer}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/SequenceMostLayer.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_sequencemostlayer, organization={Wolfram Research}, title={SequenceMostLayer}, year={2017}, url={https://reference.wolfram.com/language/ref/SequenceMostLayer.html}, note=[Accessed: 13-June-2026]}