scglue.models.sc.DataEncoder.forward

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

Encode data to sample latent distribution

Parameters
  • x (Tensor) – Input data

  • xalt (Tensor) – Alternative input data

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

Return type

Tuple[Normal, Optional[Tensor]]

Returns

  • u – Sample latent distribution

  • normalizer – Data normalizer

Note

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