MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / DropPath

Class DropPath

PATH/core/models/necks/ladder_side_attention_fpn.py:14–26  ·  view source on GitHub ↗

Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).

Source from the content-addressed store, hash-verified

12__all__ = ['LadderSideAttentionFPN', 'ResidualLadderSideAttentionFPN']
13
14class DropPath(nn.Module):
15 """Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
16 """
17
18 def __init__(self, drop_prob=None):
19 super(DropPath, self).__init__()
20 self.drop_prob = drop_prob
21
22 def forward(self, x):
23 return drop_path(x, self.drop_prob, self.training)
24
25 def extra_repr(self):
26 return 'p={}'.format(self.drop_prob)
27
28
29class Attention(nn.Module):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected