espnet2.gan_svs.visinger2.ddsp.scale_function
Less than 1 minute
espnet2.gan_svs.visinger2.ddsp.scale_function
espnet2.gan_svs.visinger2.ddsp.scale_function(x)
Scale the input tensor using a sigmoid function.
This function applies a scaling transformation to the input tensor x using the sigmoid function. The output is adjusted to a specific range and includes a small constant to avoid numerical issues.
- Parameters:x (torch.Tensor) – The input tensor to be scaled. It should have a shape compatible with the sigmoid function.
- Returns: The scaled output tensor, with the same shape as the : input tensor.
- Return type: torch.Tensor
Examples
>>> import torch
>>> x = torch.tensor([0.0, 1.0, 2.0])
>>> scaled_x = scale_function(x)
>>> print(scaled_x)
tensor([1.0000e-07, 1.0000e+00, 1.0000e+00])
NOTE
The output values are in the range of approximately [1e-7, 2] due to the nature of the sigmoid function and the scaling factor used.