mmagic.models.editors.swinir.swinir_utils
¶
Module Contents¶
Functions¶
|
A to_tuple function generator. It returns a function, this function |
|
Drop paths (Stochastic Depth) per sample (when applied in main path of |
|
|
|
|
Attributes¶
- mmagic.models.editors.swinir.swinir_utils._ntuple(n)[source]¶
A to_tuple function generator. It returns a function, this function will repeat the input to a tuple of length
n
if the input is not an Iterable object, otherwise, return the input directly.- Parameters
n (int) – The number of the target length.
- mmagic.models.editors.swinir.swinir_utils.drop_path(x, drop_prob: float = 0.0, training: bool = False, scale_by_keep: bool = True)[source]¶
Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
This is the same as the DropConnect impl I created for EfficientNet, etc networks, however, the original name is misleading as ‘Drop Connect’ is a different form of dropout in a separate paper… See discussion: https://github.com/tensorflow/tpu/issues/494#issuecomment-532968956 I’ve opted for changing the layer and argument names to ‘drop path’ rather than mix DropConnect as a layer name and use ‘survival rate’ as the argument.