예제 #1
0
 /// <summary>
 /// Randomly zero out entire channels (a channel is a 3D feature map, e.g., the jj -th channel of the ii -th sample in the batched input is a 3D tensor \text{input}[i, j]input[i,j] ).
 /// Each channel will be zeroed out independently on every forward call with probability p using samples from a Bernoulli distribution.
 /// </summary>
 /// <param name="x">Input tensor</param>
 /// <param name="probability">Probability of an element to be zeroed. Default: 0.5</param>
 /// <param name="inPlace">If set to true, will do this operation in-place. Default: false</param>
 /// <returns></returns>
 static public TorchTensor Dropout3d(TorchTensor x, double probability = 0.5, bool inPlace = false)
 {
     using (var d = Modules.Dropout3d(probability, inPlace)) {
         return(d.forward(x));
     }
 }