scglue.models.sc.DataEncoder.forward
- DataEncoder.forward(x, xrep, lazy_normalizer=True)[source]
Encode data to sample latent distribution
- Parameters
x (
torch.Tensor
) – Input dataxrep (
torch.Tensor
) – Alternative input datalazy_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
]]- Returns
u – Sample latent distribution
normalizer – Data normalizer
Note
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.