contrib.layers.dropout
tf.contrib.layers.dropout
tf.contrib.layers.dropout
dropout( inputs, keep_prob=0.5, noise_shape=None, is_training=True, outputs_collections=None, scope=None )
Defined in tensorflow/contrib/layers/python/layers/layers.py
.
Returns a dropout op applied to the input.
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 scalarTensor
with the same type as x. The probability that each element is kept. -
noise_shape
: A 1-DTensor
of typeint32
, representing the shape for randomly generated keep/drop flags. -
is_training
: A boolTensor
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.
Returns:
A tensor representing the output of the operation.
© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/layers/dropout