ertk.pytorch.utils.add_gaussian

ertk.pytorch.utils.add_gaussian(x: Tensor, sigma: float = 1, multiplicative: bool = True)

Add Gaussian noise to a tensor or batch of tensors.

Parameters:
x: torch.Tensor

Input tensor of any shape.

sigma: float

Standard deviation of Gaussian.

multiplicative: bool

Additive or multiplicative noise.

Returns:
augmented: torch.Tensor

Augmented tensor of the same shape as the x.