MCPcopy Create free account
hub / github.com/buaacxf/VIPTR / DropPath

Class DropPath

modules/SVTR.py:67–77  ·  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

65
66
67class 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
80class Identity(nn.Module):

Callers 15

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected