Transform#
- class src.data.TransformManager.TransformManager(representation_name: str, transform_name: list, tensor_noisyspeech_transform_info_dir: str, tensor_cleanspeech_transform_info_dir: str)#
Bases:
object
Class that handles the transformation of the input data.
- get_transform_info(tensor_transform_info_dir: str, map_location: str | None = None, verbose: bool = False) dict #
Method that loads transformation metadata.
- Parameters:
tensor_transform_info_dir (dict) -- transformation metadata directory.
map_location (Optional[str]) -- Remap storage location.
verbose (bool) -- Boolean that indicates weather to print specific output.
- inverse_log(coefficients_transform: Tensor) Tensor #
- inverse_log10(coefficients_transform: Tensor) Tensor #
- inverse_log_power(coefficients_transform: Tensor) Tensor #
- inverse_maxabs(coefficients_transform: Tensor) Tensor #
- inverse_normalize(coefficients_transform: Tensor, low: float = 0.0, up: float = 1.0, epsilon: float = 1e-08, quantile_flag: bool = False) Tensor #
- inverse_quantile_maxabs(coefficients_transform: Tensor) Tensor #
- inverse_shift(coefficients_transform: Tensor) Tensor #
- inverse_standardize(coefficients_transform: Tensor, mean_: float = 0.0, std_: float = 1.0) Tensor #
- log(coefficients: Tensor, epsilon: float = 1e-08) Tensor #
Method that computes logarithmic power of input data.
- Parameters:
coefficients (torch.Tensor) -- Input data.
epsilon (float) -- A small value to avoid computation error.
- log10(coefficients: Tensor, epsilon: float = 1e-08) Tensor #
Method that computes loga10 of input data.
- Parameters:
coefficients (torch.Tensor) -- Input data.
epsilon (float) -- A small value to avoid computation error.
- log_power(coefficients: Tensor, epsilon: float = 1e-08) Tensor #
Method that computes logarithmic power of input data.
- Parameters:
coefficients (torch.Tensor) -- Input data.
epsilon (float) -- A small value to avoid computation error.
- maxabs(coefficients: Tensor) Tensor #
Method that scales input data by its maximum absolute value.
- Parameters:
coefficients (torch.Tensor) -- Input data.
- normalize(coefficients: Tensor, low: float = 0.0, up: float = 1.0, epsilon: float = 1e-08, quantile_flag: bool = False) Tensor #
Method that normalizes input data.
- Parameters:
coefficients (torch.Tensor) -- Input data.
low (float) -- Lower bound.
up (float) -- Upper bound.
epsilon (float) -- A small value to avoid computation error.
quantile_flag (bool) -- Boolean that indicates weather to scale data by its q-th quantile metadata.
- quantile_maxabs(coefficients: Tensor) Tensor #
Method that scales input data by its q-th quantile metadata.
- Parameters:
coefficients (torch.Tensor) -- Input data.
- shift(coefficients: Tensor) Tensor #
Method that shifts input data.
- Parameters:
coefficients (torch.Tensor) -- Input data.
- standardize(coefficients: Tensor, mean_: float = 0.0, std_: float = 1.0) Tensor #
Method that standardizes input data.
- Parameters:
coefficients (torch.Tensor) -- Input data.
mean (float) -- Target mean.
std (float) -- Target standard deviation.