DropPath

class dragon.vm.torch.nn.DropPath(
  p=0.2,
  increment=0.0,
  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 - \text{prob})) \]

Examples:

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

__init__

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

Create a DropPath module.

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