RLPack
 
Loading...
Searching...
No Matches
rlpack.utils.normalization.Normalization Class Reference

Normalization class providing methods for normalization techniques. More...

Public Member Functions

def __init__ (self, int apply_norm, Optional[Tuple[int, int]] custom_min_max=None, float eps=5e-12, int p=2, int dim=0)
 Initialize Normalization class. More...
 
pytorch.Tensor apply_normalization (self, pytorch.Tensor tensor)
 All encompassing function to perform normalization depending on the instance's apply_norm code. More...
 
pytorch.Tensor min_max_normalization (self, pytorch.Tensor tensor)
 Method to apply min-max normalization. More...
 
pytorch.Tensor p_normalization (self, pytorch.Tensor tensor)
 The p-normalization method. More...
 
pytorch.Tensor standardization (self, pytorch.Tensor tensor)
 Method to standardize the input tensor. More...
 

Data Fields

 apply_norm
 The input apply_norm argument; indicating the normalisation to be used. More...
 
 custom_min_max
 The input custom_min_max argument. More...
 
 dim
 The input dim argument; indicating dimension along which we wish to normalise. More...
 
 eps
 The input eps argument; indicating epsilon to be used for normalisation. More...
 
 p
 The input p argument; indicating p-value for p-normalisation. More...
 

Detailed Description

Normalization class providing methods for normalization techniques.

Constructor & Destructor Documentation

◆ __init__()

def rlpack.utils.normalization.Normalization.__init__ (   self,
int  apply_norm,
Optional[Tuple[int, int]]   custom_min_max = None,
float   eps = 5e-12,
int   p = 2,
int   dim = 0 
)

Initialize Normalization class.

Parameters
apply_normint: apply_norm code for normalization. (Refer rlpack.utils.setup.Setup for more information).
custom_min_maxOptional[Tuple[int, int]]: Tuple of custom min and max value for min-max normalization. Default: None.
epsfloat: The epsilon value for normalization (small value for numerical stability). Default: 5e-12.
pint: The p-value for p-normalization. Default: 2.
dimint: The dimension along which normalization is to be applied. Default: 0.

Member Function Documentation

◆ apply_normalization()

pytorch.Tensor rlpack.utils.normalization.Normalization.apply_normalization (   self,
pytorch.Tensor  tensor 
)

All encompassing function to perform normalization depending on the instance's apply_norm code.

Parameters
tensorpytorch.Tensor: The tensor to apply normalization on.
Returns
pytorch.Tensor: The normalized tensor.

◆ min_max_normalization()

pytorch.Tensor rlpack.utils.normalization.Normalization.min_max_normalization (   self,
pytorch.Tensor  tensor 
)

Method to apply min-max normalization.

Parameters
tensorpytorch.Tensor: The input tensor to be min-max normalized.
Returns
(pytorch.Tensor): The normalized tensor.

◆ p_normalization()

pytorch.Tensor rlpack.utils.normalization.Normalization.p_normalization (   self,
pytorch.Tensor  tensor 
)

The p-normalization method.

Parameters
tensorpytorch.Tensor: The input tensor to be standardized.
Returns
pytorch.Tensor: The p-normalized tensor.

◆ standardization()

pytorch.Tensor rlpack.utils.normalization.Normalization.standardization (   self,
pytorch.Tensor  tensor 
)

Method to standardize the input tensor.

Parameters
tensorpytorch.Tensor: he input tensor to be standardized.
Returns
pytorch.Tensor: The standardized tensor.

Field Documentation

◆ apply_norm

rlpack.utils.normalization.Normalization.apply_norm

The input apply_norm argument; indicating the normalisation to be used.

◆ custom_min_max

rlpack.utils.normalization.Normalization.custom_min_max

The input custom_min_max argument.


Indicating the custom min-max values for min-max normalisation to be used.

◆ dim

rlpack.utils.normalization.Normalization.dim

The input dim argument; indicating dimension along which we wish to normalise.

◆ eps

rlpack.utils.normalization.Normalization.eps

The input eps argument; indicating epsilon to be used for normalisation.

◆ p

rlpack.utils.normalization.Normalization.p

The input p argument; indicating p-value for p-normalisation.