tf.compat.v2.nn.dropout( x, rate, noise_shape=None, seed=None, name=None )
rate, drops elements of
x. Input that are kept are scaled up by
1 / (1 - rate), otherwise outputs
0. The scaling is so that the expected sum is unchanged.
Note: The behavior of dropout has changed between TensorFlow 1.x and 2.x. When converting 1.x code, please use named arguments to ensure behavior stays consistent.
By default, each element is kept or dropped independently. If
noise_shape is specified, it must be broadcastable to the shape of
x, and only dimensions with
noise_shape[i] == shape(x)[i] will make independent decisions. For example, if
shape(x) = [k, l, m, n] and
noise_shape = [k, 1, 1, n], each batch and channel component will be kept independently and each row and column will be kept or not kept together.
| ||A floating point tensor.|
| || A scalar |
| || A 1-D |
| || A Python integer. Used to create random seeds. See |
| ||A name for this operation (optional).|
| A Tensor of the same shape of |
| || If |
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.