MCPcopy Create free account
hub / github.com/TPCD/DCCL / DropPath

Class DropPath

model/vision_transformer.py:37–45  ·  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

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

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected