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)

DropoutLayer

DropoutLayer[]
represents a net layer that sets its input elements to zero with probability 0.5 during training, multiplying the remainder by 2.

DropoutLayer[p]
sets its input elements to zero with probability p during training, multiplying the remainder by 1/p.

Details and OptionsDetails and Options

  • DropoutLayer[][input] explicitly computes the output from applying the layer.
  • DropoutLayer[][{input1,input2,}] explicitly computes outputs for each of the inputi.
  • DropoutLayer is typically used inside NetChain, NetGraph, etc.
  • DropoutLayer exposes the following ports for use in NetGraph etc.:
  • "Input"a numerical tensor of arbitrary rank
    "Output"a numerical tensor of arbitrary rank
  • DropoutLayer normally infers the dimensions of its input from its context in NetChain etc. To specify the dimensions explicitly as {n1,n2,}, use DropoutLayer["Input"->{n1,n2,}].
  • DropoutLayer only randomly sets input elements to zero during training. During evaluation, DropoutLayer leaves the input unchanged.
  • DropoutLayer is commonly used as a form of neural network regularization.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Create a dropout layer:

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

Applying the layer to data leaves it unchanged:

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