Backends/SiaNet.Backend.MxNet/NDArrayOps.cs
/// <summary>
/// Applies dropout operation to input array.- During training, each element of the input is set to zero with probability p.  The whole array is rescaled by :math:`1/(1-p)` to keep the expected  sum of the input unchanged.- During testing, this operator does not change the input if mode is 'training'.  If mode is 'always', the same computaion as during training will be applied.Example::  random.seed(998)  input_array = array([[3., 0.5,  -0.5,  2., 7.],                      [2., -0.4,   7.,  3., 0.2]])  a = symbol.Variable('a')  dropout = symbol.Dropout(a, p = 0.2)  executor = dropout.simple_bind(a = input_array.shape)  ## If training  executor.forward(is_train = True, a = input_array)  executor.outputs  [[ 3.75   0.625 -0.     2.5    8.75 ]   [ 2.5   -0.5    8.75   3.75   0.   ]]  ## If testing  executor.forward(is_train = False, a = input_array)  executor.outputs  [[ 3.     0.5   -0.5    2.     7.   ]   [ 2.    -0.4    7.     3.     0.2  ]]Defined in G:\deeplearn\mxnet\src\operator\dropout.cc:L77
/// </summary>
/// <param name="@out">output NDArray</param>
/// <param name="data">Input array to which dropout will be applied.</param>
/// <param name="p">Fraction of the input that gets dropped out during training time.</param>
/// <param name="mode">Whether to only turn on dropout during training or to also turn on for inference.</param>
/// <returns>returns new symbol</returns>
Applies dropout operation to input array.- During training, each element of the input is set to zero with probability p.  The whole array is rescaled by :math:`1/(1-p)` to keep the expected  sum of the input unchanged.- During testing, this operator does not change the input if mode is 'training'.
Applies dropout operation to input array . - During training each element of the input is set to zero with probability p . The whole array is rescaled by : math : ` 1 / ( 1 - p ) ` to keep the expected sum of the input unchanged . - During testing this operator does not change the input if mode is ' training ' .
public static NDArray Dropout(NDArray @out,
        NDArray data,
        float p = 0.5f,
        DropoutMode mode = DropoutMode.Training)
        {
            return new Operator("Dropout")
            .SetParam("p", p)
            .SetParam("mode", NDUtil.EnumToString<DropoutMode>(mode, DropoutModeConvert))
            .SetInput("data", data)
            .Invoke(@out);
        }
public static NDArray Dropout ( NDArray @out , NDArray data , float p = 0.5f , DropoutMode mode = DropoutMode . Training ) { return new Operator ( " " ) . SetParam ( " " , p ) . SetParam ( " " , NDUtil . EnumToString < DropoutMode > ( mode , DropoutModeConvert ) ) . SetInput ( " " , data ) . Invoke ( @out ) ; }
Applies dropout operation to input array.- During training, each element of the input is set to zero with probability p.  The whole array is rescaled by :math:`1/(1-p)` to keep the expected  sum of the input unchanged.- During testing, this operator does not change the input if mode is 'training'.
Applies dropout operation to input array . - During training each element of the input is set to zero with probability p . The whole array is rescaled by : math : ` 1 / ( 1 - p ) ` to keep the expected sum of the input unchanged . - During testing this operator does not change the input if mode is ' training ' .
returns new symbol
returns new symbol
@out
NDArray
None
data
NDArray
Input array to which dropout will be applied.
Input array to which dropout will be applied .
p
float
Fraction of the input that gets dropped out during training time.
Fraction of the input that gets dropped out during training time .
mode
DropoutMode
Whether to only turn on dropout during training or to also turn on for inference.
Whether to only turn on dropout during training or to also turn on for inference .