NetPrepend

NetPrepend[chain,layer]

prepends a layer onto a NetChain.

NetPrepend[chain,{layer1,layer2,}]

prepends several layers to a NetChain.

Details and Options

  • The output of the prepended layer must be compatible with the input of the first layer in the chain.
  • Any NetEncoder attached to the end of the chain will be removed.
  • NetPrepend[chain,layerspec,"Input"spec] can be used to specify a type for the input of the resulting chain, using the normal type specifications allowed by NetChain. The new port specification will replace any existing NetEncoder or type.

Examples

open allclose all

Basic Examples  (2)

Prepend several layers to the start of a chain:

Scope  (1)

Prepend a layer and attach a NetEncoder:

Possible Issues  (1)

The output of the prepended layer must be compatible with the input of the first layer in the chain:

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

Text

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

BibTeX

@misc{reference.wolfram_2020_netprepend, author="Wolfram Research", title="{NetPrepend}", year="2018", howpublished="\url{https://reference.wolfram.com/language/ref/NetPrepend.html}", note=[Accessed: 18-January-2021 ]}

BibLaTeX

@online{reference.wolfram_2020_netprepend, organization={Wolfram Research}, title={NetPrepend}, year={2018}, url={https://reference.wolfram.com/language/ref/NetPrepend.html}, note=[Accessed: 18-January-2021 ]}

CMS

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

APA

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