scglue.models.sc.DataEncoder.forward

DataEncoder.forward(x, xrep, lazy_normalizer=True)[源代码]

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

返回类型:

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.