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

Class DropPath

PATH/core/models/backbones/vit.py:28–40  ·  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

26
27
28class DropPath(nn.Module):
29 """Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
30 """
31
32 def __init__(self, drop_prob=None):
33 super(DropPath, self).__init__()
34 self.drop_prob = drop_prob
35
36 def forward(self, x):
37 return drop_path(x, self.drop_prob, self.training)
38
39 def extra_repr(self):
40 return 'p={}'.format(self.drop_prob)
41
42
43class Mlp(nn.Module):

Callers 2

__init__Method · 0.70
__init__Method · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected