SequenceIndicesLayer

SequenceIndicesLayer[]

represents a net layer that produces a list of indices for an input sequence.

Details and Options

  • SequenceIndicesLayer[] takes a sequence of arrays and outputs a sequence of integers of the same length.
  • SequenceIndicesLayer is typically used inside NetChain, NetGraph, etc.
  • The following optional parameter can be included:
  • "Maximum" Infinitymaximum index to output
  • SequenceIndicesLayer["Maximum"max] corresponds to the function Min[max,Range[Length[#]]]&.
  • The input and output ports of the net represented by SequenceIndicesLayer[] are:
  • "Input"a sequence of n arrays
    "Output"a sequence of n arrays
  • SequenceIndicesLayer["Input"shape] allows the shape of the input to be specified. Possible forms for shape include:
  • 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[SequenceIndicesLayer] gives the list of default options to construct the layer. Options[SequenceIndicesLayer[]] gives the list of default options to evaluate the layer on some data.
  • Information[SequenceIndicesLayer[]] gives a report about the layer.
  • Information[SequenceIndicesLayer[],prop] gives the value of the property prop of SequenceIndicesLayer[]. Possible properties are the same as for NetGraph.

Examples

open allclose all

Basic Examples  (1)

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

Apply the layer to a sequence of vectors:

Scope  (2)

Ports  (2)

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

Apply the layer to a sequence:

Create a SequenceIndicesLayer that expects a sequence of real numbers:

Thread the layer across a batch of inputs:

Options  (1)

"Maximum"  (1)

Create a SequenceIndicesLayer that returns a maximum index of 3:

Apply the layer to a sequence:

Possible Issues  (1)

SequenceIndicesLayer cannot accept symbolic inputs:

Wolfram Research (2021), SequenceIndicesLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html.

Text

Wolfram Research (2021), SequenceIndicesLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html.

CMS

Wolfram Language. 2021. "SequenceIndicesLayer." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html.

APA

Wolfram Language. (2021). SequenceIndicesLayer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html

BibTeX

@misc{reference.wolfram_2024_sequenceindiceslayer, author="Wolfram Research", title="{SequenceIndicesLayer}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_sequenceindiceslayer, organization={Wolfram Research}, title={SequenceIndicesLayer}, year={2021}, url={https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html}, note=[Accessed: 22-November-2024 ]}