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.

NetDelete[graph,NetPort["name"]]

deletes an output or state-input port from a NetGraph.

NetDelete[graph,{NetPort["name1"],NetPort["name2"],}]

deletes several output or state-input ports simultaneously.

Details

  • NetDelete is typically used to remove a layer or a port in a net.
  • 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.

Examples

open allclose all

Basic Examples  (2)

Delete a layer from a chain:

Delete an output port from a graph:

Scope  (5)

Delete a layer from a chain, specifying the layer by name:

Delete a layer from a graph:

Delete multiple layers from a chain:

Delete multiple output ports from a graph:

Delete an input state port from a graph:

Possible Issues  (1)

If the layer being deleted is in the interior of a chain or graph, it must have exactly one input and output, which must be the same shape:

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

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_netdelete, organization={Wolfram Research}, title={NetDelete}, year={2018}, url={https://reference.wolfram.com/language/ref/NetDelete.html}, note=[Accessed: 22-December-2024 ]}