Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
| 65 | |
| 66 | |
| 67 | class DropPath(nn.Module): |
| 68 | """Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks). |
| 69 | """ |
| 70 | |
| 71 | def __init__(self, local_rank, drop_prob=None): |
| 72 | super(DropPath, self).__init__() |
| 73 | self.drop_prob = drop_prob |
| 74 | self.local_rank = local_rank |
| 75 | |
| 76 | def forward(self, x): |
| 77 | return drop_path(x, self.local_rank, self.drop_prob, self.training) |
| 78 | |
| 79 | |
| 80 | class Identity(nn.Module): |
no outgoing calls
no test coverage detected