- All Implemented Interfaces:
Function<Tensor,Tensor>
, Layer
public class StochasticDepth
extends Object
implements Layer
Stochastic Depth for randomly dropping residual branches of residual
architectures, from "Deep Networks with Stochastic Depth".
-
Constructor Summary
Constructors
-
Method Summary
org.bytedeco.pytorch.Module
Returns the PyTorch Module object.
Forward propagation (or forward pass) through the layer.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
StochasticDepth
public StochasticDepth(double p,
String mode)
Constructor.
- Parameters:
p
- the number of channels in the input image.
mode
- "batch" or "row". "batch" randomly zeroes the entire input,
"row" zeroes randomly selected rows from the batch.
-
Method Details
-
asTorch
public org.bytedeco.pytorch.Module asTorch()
Description copied from interface: Layer
Returns the PyTorch Module object.
- Specified by:
asTorch
in interface Layer
- Returns:
- the PyTorch Module object.
-
forward
Description copied from interface: Layer
Forward propagation (or forward pass) through the layer.
- Specified by:
forward
in interface Layer
- Parameters:
input
- the input tensor.
- Returns:
- the output tensor.