dropout
Description
(Functionally the same as tf.nn.dropout.) Scales the elements of an input tensor by 1/keep_prob where keep_prob indicates the preservation probability of the input tensor and outputs a tensor of the same shape of the input tensor. Elements not rescaled are set to 0.
Prototype
def dropout(x, keep_prob, noise_shape=None, seed=None, name=None)
Options
Option |
Input/Output |
Description |
|---|---|---|
x |
Input |
Input tensor of type float. |
keep_prob |
Input |
Scalar tensor of type float, which indicates the retention probability of each element. |
noise_shape |
Input |
1D tensor of type int32, which indicates the shape of the randomly generated keep/drop flag. |
seed |
Input |
Random seed. |
name |
Input |
Name of the network layer. |
Returns
Result tensor after the dropout operation is performed on input x.
Example
1 2 | from npu_bridge.npu_init import * layers = npu_ops.dropout() |
Parent topic: npu_bridge.estimator.npu_ops