MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / DropPath

Class DropPath

selfpatch_vision_transformer.py:41–49  ·  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

39
40
41class DropPath(nn.Module):
42 """Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
43 """
44 def __init__(self, drop_prob=None):
45 super(DropPath, self).__init__()
46 self.drop_prob = drop_prob
47
48 def forward(self, x):
49 return drop_path(x, self.drop_prob, self.training)
50
51
52class Mlp(nn.Module):

Callers 3

__init__Method · 0.70
__init__Method · 0.70
__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected