DropPath

class dragon.vm.torch.nn.DropPath(
  p=0.2,
  inplace=False
)[source]

Set the examples over input to zero randomly. [Larsson et.al, 2016].

The DropPath function is defined as:

\[\text{DropPath}(x_{ij}) = x_{ij} * (r_{i} \sim \mathcal{B}(1, 1 - p)) \]

Examples:

x = torch.ones(5, 2, 2, 2)
m = torch.nn.DropPath()
y = m(x)

__init__

DropPath.__init__(
  p=0.2,
  inplace=False
)[source]

Create a DropPath module.

Parameters:
  • p (float, optional, default=0.2) The dropping ratio.
  • inplace (bool, optional, default=False) Whether to do the operation in-place.