Noise Layers
DL4J equivalents and API reference for Keras noise layers — GaussianNoise, GaussianDropout, and AlphaDropout.
Keras Noise Layer Import
Noise layers add stochastic regularization during training. Support is implemented in the layers/noise package.
Support Summary
GaussianNoise
DropoutLayer (GaussianNoise)
Yes
GaussianDropout
DropoutLayer (GaussianDropout)
Yes
AlphaDropout
DropoutLayer (AlphaDropout)
Yes
KerasGaussianNoise
Imports a Keras GaussianNoise layer as a DL4J DropoutLayer with GaussianNoise applied to the activations during training. The standard deviation stddev is read from the Keras configuration.
output = input + N(0, stddev) during training
output = input during inferenceConstructor
public KerasGaussianNoise(Integer kerasVersion) throws UnsupportedKerasConfigurationExceptiongetGaussianNoiseLayer
public DropoutLayer getGaussianNoiseLayer()Returns the DL4J DropoutLayer configured with Gaussian noise.
getOutputType
KerasGaussianDropout
Imports a Keras GaussianDropout layer as a DL4J DropoutLayer with GaussianDropout. This multiplies activations by a Gaussian noise factor with mean 1 and variance derived from the dropout rate rate:
Constructor
getGaussianDropoutLayer
Returns the DL4J DropoutLayer configured with Gaussian dropout.
getOutputType
KerasAlphaDropout
Imports a Keras AlphaDropout layer as a DL4J DropoutLayer with AlphaDropout. AlphaDropout is designed for use with SELU activations; it preserves the mean and variance of activations after applying dropout by setting dropped-out units to the negative saturation value of SELU.
Constructor
getAlphaDropoutLayer
Returns the DL4J DropoutLayer configured with AlphaDropout.
getOutputType
Notes
All noise layers are applied only during training. At inference time they are identity functions. DL4J handles this through the
LayerWorkspaceMgrtraining/test mode flag.AlphaDropoutis intended to be used withSELUactivations and thelecun_normalinitializer. If your Keras model used this combination, verify that the DL4J model is also initialized withlecun_normal(which it will be if weights are loaded from HDF5).Noise layers have no trainable parameters;
setWeightsis a no-op for these classes.
Last updated
Was this helpful?