espnet2.layers.global_mvn.GlobalMVN
Less than 1 minute
espnet2.layers.global_mvn.GlobalMVN
class espnet2.layers.global_mvn.GlobalMVN(stats_file: Path | str, norm_means: bool = True, norm_vars: bool = True, eps: float = 1e-20)
Bases: AbsNormalize
, InversibleInterface
Apply global mean and variance normalization
TODO(kamo): Make this class portable somehow
- Parameters:
- stats_file – npy file
- norm_means – Apply mean normalization
- norm_vars – Apply var normalization
- eps
Initializes internal Module state, shared by both nn.Module and ScriptModule.
extra_repr()
Set the extra representation of the module
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
forward(x: Tensor, ilens: Tensor | None = None) → Tuple[Tensor, Tensor]
Forward function
- Parameters:
- x – (B, L, …)
- ilens – (B,)
inverse(x: Tensor, ilens: Tensor | None = None) → Tuple[Tensor, Tensor]