Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)
BUILT-IN WOLFRAM LANGUAGE SYMBOL

NetPort

NetPort[n,"port"]
represents the specified port for layer number n in a NetGraph or similar construct.

NetPort["name","port"]
represents the specified port for the layer with the specified name.

NetPort["port"]
represents the specified input or output port for a complete net.

DetailsDetails

  • When used in NetGraph, NetPort[layer,"port"] refers to the named output port of a layer when used on the left-hand side of a rule, and a named input port of a layer when used on the right-hand side of a rule.
  • When used in a NetGraph, NetPort["port"] refers to an input of the entire graph when used on the left-hand side of a rule, and an output of the entire graph when used on the right-hand side of a rule.

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Create a graph with two outputs having custom names:

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

Create a graph with two inputs having custom names:

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

Create a graph with a loss layer:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2016
(11.0)