gt4sd.frameworks.torch.vae module

pytorch utils for VAEs.

Summary

Functions:

reparameterize

Applies reparametrization trick to obtain sample from latent space.

Reference

reparameterize(mu, logvar)[source]

Applies reparametrization trick to obtain sample from latent space.

Parameters
  • mu (Tensor) – the latent means of shape batch_size x latent_size.

  • logvar (Tensor) – latent log variances, shape batch_size x latent_size.

Returns

sampled Z from the latent distribution.

Return type

torch.Tensor