MCPcopy Create free account
hub / github.com/KlingAIResearch/LivePortrait / DropPath

Class DropPath

src/modules/util.py:428–438  ·  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

426
427
428class DropPath(nn.Module):
429 """ Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
430 """
431
432 def __init__(self, drop_prob=None, scale_by_keep=True):
433 super(DropPath, self).__init__()
434 self.drop_prob = drop_prob
435 self.scale_by_keep = scale_by_keep
436
437 def forward(self, x):
438 return drop_path(x, self.drop_prob, self.training, self.scale_by_keep)
439
440
441def trunc_normal_(tensor, mean=0., std=1., a=-2., b=2.):

Callers 3

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected