PrependLayer

PrependLayer[]

represents a net layer that takes an input array and prepends another array to it.

Details and Options

  • PrependLayer exposes the following input ports for use in NetGraph etc.:
  • "Input"array of rank n
    "Element"array of rank n-1
  • PrependLayer exposes the output port "Output", which is an array of rank n.
  • PrependLayer is typically used inside NetGraph.
  • PrependLayer can operate on arrays that contain "Varying" dimensions.
  • PrependLayer[][<|"Input"in,"Element"elem|>] explicitly computes the output from applying the layer, which is effectively given by Prepend[in,elem].
  • When given a NumericArray as input, the output will be a NumericArray.
  • PrependLayer["port"->shape] allows the shape of the input or element port to be specified. Possible forms for shape are:
  • "Real"a single real number
    "Integer"a single integer
    na vector of length n
    {n1,n2,}an array of dimensions n1× n2×
    {"Varying",n2,n3,}a variable-length sequence of arrays of dimensions n2×n3×
  • Options[PrependLayer] gives the list of default options to construct the layer. Options[PrependLayer[]] gives the list of default options to evaluate the layer on some data.
  • Information[PrependLayer[]] gives a report about the layer.
  • Information[PrependLayer[],prop] gives the value of the property prop of PrependLayer[]. Possible properties are the same as for NetGraph.

Examples

open allclose all

Basic Examples  (2)

Create a PrependLayer:

Create a PrependLayer that takes a vector as input and appends a scalar:

Apply this layer to inputs:

Scope  (1)

Ports  (1)

Create a PrependLayer that takes a sequence of vectors as input and appends another vector to it:

Apply this layer to inputs:

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

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

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