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
| 29 | |
| 30 | |
| 31 | class DropPath(nn.Module): |
| 32 | """ |
| 33 | Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks). |
| 34 | "Deep Networks with Stochastic Depth", https://arxiv.org/pdf/1603.09382.pdf |
| 35 | """ |
| 36 | def __init__(self, drop_prob=None): |
| 37 | super(DropPath, self).__init__() |
| 38 | self.drop_prob = drop_prob |
| 39 | |
| 40 | def forward(self, x): |
| 41 | return drop_path(x, self.drop_prob, self.training) |
| 42 | |
| 43 | |
| 44 | class ConvBNAct(nn.Module): |