norm
model.backbone.norm
FrozenBatchNorm2d
Bases: Module
BatchNorm2d where the batch statistics and the affine parameters are fixed
Attributes:
-
weight(Tensor) –batch_norm weight. not nn.Parameter for freezing values.
-
bias(Tensor) –batch_norm bias. not nn.Parameter for freezing values.
-
running_mean(Tensor) –batch_norm running_mean. not nn.Parameter for freezing values.
-
running_var(Tensor) –batch_norm running_var. not nn.Parameter for freezing values.
Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
Initializing FrozenBatchNorm2d
Parameters:
-
n(int) –number of channels for torch.Tensor
Source code in SaigeToolkit/model/backbone/norm.py
forward
forward function for FrozenBatchNorm2d
Parameters:
-
x(Tensor) –input tensor
Returns:
-
Tensor–torch.Tensor: batch_normalized output tensor
Source code in SaigeToolkit/model/backbone/norm.py
get_norm
getting customized batch norm class
Parameters:
-
name(str) –batch norm class name
Returns:
-
Type[Module]–Type[nn.Module]: custom batch norm class