Class StochasticDepth

java.lang.Object
smile.vision.layer.StochasticDepth
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 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

      public Tensor forward(Tensor input)
      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.