espnet2.enh.diffusion.sampling.correctors.NoneCorrector
espnet2.enh.diffusion.sampling.correctors.NoneCorrector
class espnet2.enh.diffusion.sampling.correctors.NoneCorrector(*args, **kwargs)
Bases: Corrector
NoneCorrector is an implementation of the Corrector class that performs no
operations during the update phase. It is essentially a placeholder corrector that can be used in scenarios where no correction is needed.
snr
The signal-to-noise ratio, set to 0.
- Type: float
n_steps
The number of steps, set to 0.
Type: int
Parameters:
- *args – Additional positional arguments (not used).
- **kwargs – Additional keyword arguments (not used).
Returns: The input tensor unchanged. x (torch.Tensor): The input tensor unchanged.
Return type: x (torch.Tensor)
####### Examples
>>> corrector = NoneCorrector()
>>> x = torch.tensor([[1.0, 2.0], [3.0, 4.0]])
>>> t = torch.tensor([0.5])
>>> next_state, next_mean = corrector.update_fn(x, t)
>>> print(next_state)
tensor([[1.0, 2.0], [3.0, 4.0]])
>>> print(next_mean)
tensor([[1.0, 2.0], [3.0, 4.0]])
NOTE
This corrector is useful for situations where a corrector interface is required but no actual correction is needed.
update_fn(x, t, *args)
An empty corrector that does nothing.
This corrector is used when no correction is needed. It simply returns the input state as the output state without any modifications.
snr
Signal-to-noise ratio, initialized to 0.
- Type: float
n_steps
Number of steps for the correction process, initialized to 0.
Type: int
Parameters:
- *args – Additional positional arguments (not used).
- **kwargs – Additional keyword arguments (not used).
Returns: A tuple containing: : - x (torch.Tensor): The input state tensor, unchanged.
- x (torch.Tensor): The input state tensor, unchanged.
Return type: tuple
####### Examples
>>> corrector = NoneCorrector()
>>> x = torch.tensor([[1.0, 2.0], [3.0, 4.0]])
>>> t = torch.tensor([0.5])
>>> updated_x, x_mean = corrector.update_fn(x, t)
>>> print(updated_x)
tensor([[1., 2.],
[3., 4.]])
>>> print(x_mean)
tensor([[1., 2.],
[3., 4.]])