tf.contrib.layers.dropout
Stay organized with collections
Save and categorize content based on your preferences.
Returns a dropout op applied to the input.
tf.contrib.layers.dropout(
inputs, keep_prob=0.5, noise_shape=None, is_training=True,
outputs_collections=None, scope=None, seed=None
)
With probability keep_prob
, outputs the input element scaled up by
1 / keep_prob
, otherwise outputs 0
. The scaling is so that the expected
sum is unchanged.
Args |
inputs
|
The tensor to pass to the nn.dropout op.
|
keep_prob
|
A scalar Tensor with the same type as x. The probability that
each element is kept.
|
noise_shape
|
A 1-D Tensor of type int32 , representing the shape for
randomly generated keep/drop flags.
|
is_training
|
A bool Tensor indicating whether or not the model is in
training mode. If so, dropout is applied and values scaled. Otherwise,
inputs is returned.
|
outputs_collections
|
Collection to add the outputs.
|
scope
|
Optional scope for name_scope.
|
seed
|
A Python integer. Used to create random seeds. See
tf.compat.v1.set_random_seed for behavior.
|
Returns |
A tensor representing the output of the operation.
|
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.contrib.layers.dropout\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/layers/python/layers/layers.py#L1572-L1613) |\n\nReturns a dropout op applied to the input. \n\n tf.contrib.layers.dropout(\n inputs, keep_prob=0.5, noise_shape=None, is_training=True,\n outputs_collections=None, scope=None, seed=None\n )\n\nWith probability `keep_prob`, outputs the input element scaled up by\n`1 / keep_prob`, otherwise outputs `0`. The scaling is so that the expected\nsum is unchanged.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `inputs` | The tensor to pass to the nn.dropout op. |\n| `keep_prob` | A scalar `Tensor` with the same type as x. The probability that each element is kept. |\n| `noise_shape` | A 1-D `Tensor` of type `int32`, representing the shape for randomly generated keep/drop flags. |\n| `is_training` | A bool `Tensor` indicating whether or not the model is in training mode. If so, dropout is applied and values scaled. Otherwise, inputs is returned. |\n| `outputs_collections` | Collection to add the outputs. |\n| `scope` | Optional scope for name_scope. |\n| `seed` | A Python integer. Used to create random seeds. See [`tf.compat.v1.set_random_seed`](../../../tf/random/set_random_seed) for behavior. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A tensor representing the output of the operation. ||\n\n\u003cbr /\u003e"]]