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

NetExtract

NetExtract[layer,"param"]
extracts the value of a parameter for the specified net layer.

NetExtract[net,lspec]
extracts the layer identified by lspec from within the NetGraph or NetChain object net.

NetExtract[net,{lspec,"param"}]
extracts the value of the parameter param from the layer identified by lspec in net.

DetailsDetails

  • NetExtract supports the layer specification All to indicate that an association or list should be returned, giving all the layers within a NetGraph or NetChain.
  • The layer specification can be an integer indicating the nth layer or a string indicating a named layer.
  • Parameter specifications can be the names of any of the arrays or options contained within a layer.
  • NetExtract returns Automatic if a requested parameter has not been explicitly specified for a layer.

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Create a randomly initialized layer:

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

Extract the weight matrix from the layer:

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

Create a net:

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

Extract the first layer:

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

Extract a named layer:

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

Extract the kernel size of the first layer:

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

Create an initialized net:

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

Obtain the weights from a specific layer:

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

Obtain the weights from all layers:

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

Create a NetGraph object with named layers:

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

Extract a named layer:

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