I\'m quite confused about whether to use tf.nn.dropout or tf.layers.dropout.
many MNIST CNN examples seems to use tf.nn.droput, with keep_prop as one of params.
A quick glance through
tensorflow/python/layers/core.py and tensorflow/python/ops/nn_ops.py
reveals that tf.layers.dropout
is a wrapper for tf.nn.dropout
.
The only differences in the two functions are:
tf.nn.dropout
has parameter keep_prob
: "Probability that each element is kept"tf.layers.dropout
has parameter rate
: "The dropout rate"keep_prob = 1 - rate
as defined heretf.layers.dropout
has training
parameter: "Whether to return the output in training mode (apply dropout) or in inference mode (return the input untouched)."