tf.keras.layers.SpatialDropout3D
Stay organized with collections
Save and categorize content based on your preferences.
Spatial 3D version of Dropout.
Inherits From: Dropout
tf.keras.layers.SpatialDropout3D(
rate, data_format=None, **kwargs
)
This version performs the same function as Dropout, however it drops
entire 3D feature maps instead of individual elements. If adjacent voxels
within feature maps are strongly correlated (as is normally the case in
early convolution layers) then regular dropout will not regularize the
activations and will otherwise just result in an effective learning rate
decrease. In this case, SpatialDropout3D will help promote independence
between feature maps and should be used instead.
Arguments |
rate
|
Float between 0 and 1. Fraction of the input units to drop.
|
data_format
|
'channels_first' or 'channels_last'.
In 'channels_first' mode, the channels dimension (the depth)
is at index 1, in 'channels_last' mode is it at index 4.
It defaults to the image_data_format value found in your
Keras config file at ~/.keras/keras.json .
If you never set it, then it will be "channels_last".
|
Call arguments:
inputs
: A 5D tensor.
training
: Python boolean indicating whether the layer should behave in
training mode (adding dropout) or in inference mode (doing nothing).
5D tensor with shape:
(samples, channels, dim1, dim2, dim3)
if data_format='channels_first'
or 5D tensor with shape:
(samples, dim1, dim2, dim3, channels)
if data_format='channels_last'.
Output shape:
Same as input.
References:
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.keras.layers.SpatialDropout3D\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/keras/layers/SpatialDropout3D) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/keras/layers/core.py#L284-L338) |\n\nSpatial 3D version of Dropout.\n\nInherits From: [`Dropout`](../../../tf/keras/layers/Dropout)\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.keras.layers.SpatialDropout3D`](/api_docs/python/tf/keras/layers/SpatialDropout3D), \\`tf.compat.v2.keras.layers.SpatialDropout3D\\`\n\n\u003cbr /\u003e\n\n tf.keras.layers.SpatialDropout3D(\n rate, data_format=None, **kwargs\n )\n\nThis version performs the same function as Dropout, however it drops\nentire 3D feature maps instead of individual elements. If adjacent voxels\nwithin feature maps are strongly correlated (as is normally the case in\nearly convolution layers) then regular dropout will not regularize the\nactivations and will otherwise just result in an effective learning rate\ndecrease. In this case, SpatialDropout3D will help promote independence\nbetween feature maps and should be used instead.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Arguments --------- ||\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `rate` | Float between 0 and 1. Fraction of the input units to drop. |\n| `data_format` | 'channels_first' or 'channels_last'. In 'channels_first' mode, the channels dimension (the depth) is at index 1, in 'channels_last' mode is it at index 4. It defaults to the `image_data_format` value found in your Keras config file at `~/.keras/keras.json`. If you never set it, then it will be \"channels_last\". |\n\n\u003cbr /\u003e\n\n#### Call arguments:\n\n- **`inputs`**: A 5D tensor.\n- **`training`**: Python boolean indicating whether the layer should behave in training mode (adding dropout) or in inference mode (doing nothing).\n\n#### Input shape:\n\n5D tensor with shape:\n`(samples, channels, dim1, dim2, dim3)` if data_format='channels_first'\nor 5D tensor with shape:\n`(samples, dim1, dim2, dim3, channels)` if data_format='channels_last'.\n\n#### Output shape:\n\nSame as input.\n\n#### References:\n\n- [Efficient Object Localization Using Convolutional\n Networks](https://arxiv.org/abs/1411.4280)"]]