Skip to main content

drop_path

Function drop_path 

Source
pub fn drop_path<B: Backend, const D: usize>(
    x: Tensor<B, D>,
    drop_prob: f64,
    training: bool,
    scale_by_keep: bool,
) -> Tensor<B, D>
Expand description

DropPath (stochastic depth) regularization.

§Arguments

  • x: Input tensor.
  • drop_prob: Probability of dropping a path.
  • training: Whether the model is in training mode.
  • scale_by_keep: Whether to scale the output by 1 / (1 - drop_prob)

§Returns

  • Output tensor with the same shape as the input tensor.