mindspore.nn.probability.dpn.VAE
- class mindspore.nn.probability.dpn.VAE(encoder, decoder, hidden_size, latent_size)[source]
Variational Auto-Encoder (VAE).
The VAE defines a generative model, Z is sampled from the prior, then used to reconstruct X by a decoder. For more details, refer to Auto-Encoding Variational Bayes.
Note
When the encoder and decoder are defined, the shape of the encoder’s output tensor and decoder’s input tensor must be \((N, hidden\_size)\). The latent_size must be less than or equal to the hidden_size.
- Parameters
- Inputs:
input (Tensor) - The shape of input tensor is \((N, C, H, W)\), which is the same as the input of encoder.
- Outputs:
output (Tuple) - (recon_x(Tensor), x(Tensor), mu(Tensor), std(Tensor)).
- Supported Platforms:
Ascend
GPU