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)

In[1]:=
Click for copyable input
Out[1]=

Prepend several layers to the start of a chain:

In[1]:=
Click for copyable input
Out[1]=

Scope  (1)

Possible Issues  (1)

See Also

NetAppend  Prepend  NetInsert  NetDelete  NetTake  NetDrop  NetExtract  NetFlatten  NetReplace  NetReplacePart  NetRename  NetChain  NetEncoder

Tutorials

Introduced in 2018
(11.3)