(self, num_features, eps=1e-5, momentum=0.1, affine=True, activation="leaky_relu", slope=0.01)
Creates an InPlace Activated Batch Normalization module

        Parameters
        ----------
        num_features : int
            Number of feature channels in the input and output.
        eps : float
            Small constant to prevent numerical issues.
        momentum : float
            Momentum factor applied to compute running statistics as.
        affine : bool
            If `True` apply learned scale and shift transformation after normalization.
        activation : str
            Name of the activation functions, one of: `leaky_relu`, `elu` or `none`.
        slope : float
            Negative slope for the `leaky_relu` activation.
Creates an InPlace Activated Batch Normalization module
Creates an InPlace Activated Batch Normalization module
def __init__(self, num_features, eps=1e-5, momentum=0.1, affine=True, activation="leaky_relu", slope=0.01):
        """Creates an InPlace Activated Batch Normalization module

        Parameters
        ----------
        num_features : int
            Number of feature channels in the input and output.
        eps : float
            Small constant to prevent numerical issues.
        momentum : float
            Momentum factor applied to compute running statistics as.
        affine : bool
            If `True` apply learned scale and shift transformation after normalization.
        activation : str
            Name of the activation functions, one of: `leaky_relu`, `elu` or `none`.
        slope : float
            Negative slope for the `leaky_relu` activation.
        """
        super(InPlaceABN, self).__init__()
        self.num_features = num_features
        self.affine = affine
        self.eps = eps
        self.momentum = momentum
        self.activation = activation
        self.slope = slope
        if self.affine:
            self.weight = nn.Parameter(torch.Tensor(num_features))
            self.bias = nn.Parameter(torch.Tensor(num_features))
        else:
            self.register_parameter('weight', None)
            self.register_parameter('bias', None)
        self.register_buffer('running_mean', torch.zeros(num_features))
        self.register_buffer('running_var', torch.ones(num_features))
        self.reset_parameters()
def __init__ ( self , num_features , eps = 1e-5 , momentum = 0.1 , affine = True , activation = "leaky_relu" , slope = 0.01 ) : super ( InPlaceABN , self ) . __init__ ( ) self . num_features = num_features self . affine = affine self . eps = eps self . momentum = momentum self . activation = activation self . slope = slope if self . affine : self . weight = nn . Parameter ( torch . Tensor ( num_features ) ) self . bias = nn . Parameter ( torch . Tensor ( num_features ) ) else : self . register_parameter ( 'weight' , None ) self . register_parameter ( 'bias' , None ) self . register_buffer ( 'running_mean' , torch . zeros ( num_features ) ) self . register_buffer ( 'running_var' , torch . ones ( num_features ) ) self . reset_parameters ( )