NormalSampler¶
Basic sampler sampling from a N(0, 1) in the Autoencoder’s latent space.
Available models:¶
Vanilla Autoencoder model. |
|
Vanilla Variational Autoencoder model. |
|
\(\beta\)-VAE model. |
|
Variational Auto Encoder with linear Normalizing Flows model. |
|
Variational Auto Encoder with Inverse Autoregressive Flows ( |
|
Disentangled \(\beta\)-VAE model. |
|
FactorVAE model. |
|
\(\beta\)-TCVAE model. |
|
Importance Weighted Autoencoder model. |
|
VAE using perseptual similarity metrics model. |
|
Wasserstein Autoencoder model. |
|
Info Variational Autoencoder model. |
|
Variational Mixture of Posteriors (VAMP) VAE model |
|
\(\mathcal{S}\)-VAE model. |
|
Adversarial Autoencoder model. |
|
Variational Autoencoder using Adversarial reconstruction loss model. |
|
Vector Quantized-VAE model. |
|
Hamiltonian VAE. |
|
Regularized Autoencoder with gradient penalty model. |
|
Regularized Autoencoder with L2 decoder params regularization model. |
|
Riemannian Hamiltonian VAE model. |
- class pythae.samplers.NormalSampler(model, sampler_config=None)[source]¶
Samples from a Standard normal distribution in the Autoencoder’s latent space.
- Parameters
model (BaseAE) – The vae model to sample from.
sampler_config (BaseSamplerConfig) – An instance of BaseSamplerConfig in which any sampler’s parameters is made available. If None a default configuration is used. Default: None
- sample(num_samples=1, batch_size=500, output_dir=None, return_gen=True, save_sampler_config=False)[source]¶
Main sampling function of the sampler.
- Parameters
num_samples (int) – The number of samples to generate
batch_size (int) – The batch size to use during sampling
output_dir (str) – The directory where the images will be saved. If does not exist the folder is created. If None: the images are not saved. Defaults: None.
return_gen (bool) – Whether the sampler should directly return a tensor of generated data. Default: True.
save_sampler_config (bool) – Whether to save the sampler config. It is saved in output_dir.
- Returns
The generated images
- Return type