NetDelete

NetDelete[net,n]

deletes the n^(th) layer from a NetChain or NetGraph.

NetDelete[net,"name"]

deletes a named layer.

NetDelete[net,{spec1,spec2,}]

deletes several layers simultaneously.

Details

  • Layers can only be deleted from a chain or graph if their inputs and outputs are the same size, or if they are at the periphery of the network.
  • For NetDrop[chain,{start,end}], the start and end can be given as an integer n, which specifies the n^(th) layer, or "name", which specifies a named layer in a NetChain that was constructed using <|"name"->layer,|>.

Examples

open allclose all

Basic Examples  (1)

Delete a layer from a chain:

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

Scope  (3)

Possible Issues  (1)

See Also

Delete  NetInsert  NetAppend  NetPrepend  NetTake  NetDrop  NetFlatten  NetReplace  NetReplacePart  NetRename  NetChain  NetGraph

Tutorials

Introduced in 2018
(11.3)