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)

DotPlusLayer

DotPlusLayer[n]
represents a trainable, fully connected net layer that computes with output of size n.

DotPlusLayer[n,opts]
includes options for initial weights and other parameters.

Details and OptionsDetails and Options

  • The following optional parameters can be included:
  • "Biases"Automaticinitial vector of biases (b in w.x+b)
    "Weights"Automaticinitial matrix of weights (w in w.x+b)
  • When weights and biases are not explicitly specified or are given as Automatic, they are added automatically when NetInitialize or NetTrain is used.
  • The setting "Biases"->None specifies that no biases should be used.
  • If weights and biases have been added, DotPlusLayer[][input] explicitly computes the output from applying the layer.
  • DotPlusLayer[][{input1,input2,}] explicitly computes outputs for each of the inputi.
  • NetExtract can be used to extract weights and biases from a DotPlusLayer object.
  • DotPlusLayer is typically used inside NetChain, NetGraph, etc.
  • DotPlusLayer exposes the following ports for use in NetGraph etc.:
  • "Input"a numerical vector
    "Output"a numerical vector of length n
  • When it cannot be inferred from other layers in a larger net, the option "Input"m can be used to fix the input of DotPlusLayer to be a vector of length m.

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Create a dot plus layer whose input size is 3 and output size is 5:

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

Create an uninitialized layer:

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

Initialize the layer with random weights:

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

Apply the layer to an input vector to produce an output vector:

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

Create a randomly initialized dot plus layer that takes in a class label using a NetEncoder:

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

Apply the layer to a member of the class:

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

Specify specific weight and bias matrices:

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

Apply the layer to an input:

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