DataEncoder.forward(x, xrep, lazy_normalizer=True)[source]

Encode data to sample latent distribution

  • x (torch.Tensor) – Input data

  • xrep (torch.Tensor) – Alternative input data

  • lazy_normalizer (bool) – Whether to skip computing x normalizer (just return None) if xrep is non-empty

Return type:

typing.Tuple[torch.distributions.normal.Normal, typing.Optional[torch.Tensor]]


  • u – Sample latent distribution

  • normalizer – Data normalizer


Normalization is always computed on x. If xrep is empty, the normalized x will be used as input to the encoder neural network, otherwise xrep is used instead.