MCPcopy Create free account
hub / github.com/PowerHouseMan/ComfyUI-AdvancedLivePortrait / DropPath

Class DropPath

LivePortrait/modules/util.py:427–437  ·  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

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

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected