Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks). "Deep Networks with Stochastic Depth", https://arxiv.org/pdf/1603.09382.pdf
| 44 | return output |
| 45 | |
| 46 | class DropPath(nn.Module): |
| 47 | """ |
| 48 | Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks). |
| 49 | "Deep Networks with Stochastic Depth", https://arxiv.org/pdf/1603.09382.pdf |
| 50 | """ |
| 51 | def __init__(self, drop_prob=None): |
| 52 | super(DropPath, self).__init__() |
| 53 | self.drop_prob = drop_prob |
| 54 | |
| 55 | def forward(self, x): |
| 56 | return drop_path(x, self.drop_prob, self.training) |
| 57 | |
| 58 | |
| 59 | class ConvBNActivation(nn.Sequential): |