neuraltrain.models.common.NormDenormScaler

class neuraltrain.models.common.NormDenormScaler(x: Tensor, affine: bool = True)[source][source]

Norm-denorm scaler inspired by [1].

At inference time, this module applies z-score normalization of its input, followed by de-normalization based on the statistics of the data seen at instantiation.

Parameters:
  • x – Data on which to fit the denormalizer, of shape (n_examples, n_features).

  • affine – If True, de-normalize with the statistics of x.

References

forward(x: Tensor) Tensor[source][source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.