drop_block2d

dragon.nn.drop_block2d(
  inputs,
  block_size=7,
  keep_prob=0.9,
  alpha=1.0,
  decrement=0.0,
  data_format='NCHW',
  **kwargs
)[source]

Set the spatial blocks over input to zero randomly. [Ghiasi et.al, 2018].

The DropBlock function is defined as:

\[\text{DropBlock}(x_{ijk} = x_{ijk} * (r_{ik} \sim \mathcal{B}(1, \alpha\gamma)) \\ \quad \\ \text{where}\quad \gamma = \frac{\text{keep\_prob}}{\text{block\_size}^{n}} \frac{\text{feat\_size}^{n}}{(\text{feat\_size} - \text{block\_size} + 1)^n} \]

Set the decrement to schedule keep_prob from 1.0.

Set the alpha to decrease \(\gamma\) for different stages.

Parameters:
  • inputs (dragon.Tensor) – The input tensor.
  • block_size (int, optional, default=7) – The size of a spatial block.
  • keep_prob (Union[float, dragon.Tensor], optional, default=0.9) – The keeping prob.
  • alpha (float, optional, default=1.) – The value to \(\gamma\).
  • decrement (float, optional, default=0.) – The decrement value to keep_prob.
  • data_format ({'NCHW', 'NHWC'}, optional) – The optional data format.
Returns:

dragon.Tensor – The output tensor.