Dropout2D

neuralpy.layers.regularizers.Dropout2D(p=0.5, name=None)
info

Dropout2D is mostly stable and can be used for any project. In the future, any chance of breaking changes is very low.

Applies the Dropout2D layer to the input tensor.

The Dropout2D layer randomly sets entire channel units to 0 with a frequency of rate of p at each step during training time. It helps prevent overfitting.

Usually the input comes from nn.Conv2D modules.

For more information, check this page

Supported Arguments

  • p=0.5: (Float) Probability of an element to be zeroed. The value should be between 0.0 and 1.0.
  • name=None: (String) Name of the layer, if not provided then automatically calculates a unique name for the layer

Example Code

from neuralpy.models import Sequential
from neuralpy.layers.regularizers import Dropout2D
# Initializing the Sequential models
model = Sequential()
...
...
...
model.add(Dropout2D(p=0.5, name="MyDropoutLayer"))