mindspore.nn.probability.infer.ELBO

class mindspore.nn.probability.infer.ELBO(latent_prior='Normal', output_prior='Normal')[source]

The Evidence Lower Bound (ELBO).

Variational inference minimizes the Kullback-Leibler (KL) divergence from the variational distribution to the posterior distribution. It maximizes the ELBO, a lower bound on the logarithm of the marginal probability of the observations log p(x). The ELBO is equal to the negative KL divergence up to an additive constant. For more details, refer to Variational Inference: A Review for Statisticians.

Parameters
  • latent_prior (str) – The prior distribution of latent space. Default: Normal. - Normal: The prior distribution of latent space is Normal.

  • output_prior (str) – The distribution of output data. Default: Normal. - Normal: If the distribution of output data is Normal, the reconstruct loss is MSELoss.

Inputs:
  • input_data (Tuple) - (recon_x(Tensor), x(Tensor), mu(Tensor), std(Tensor)).

  • target_data (Tensor) - the target tensor of shape \((N,)\).

Outputs:

Tensor, loss float tensor.

Supported Platforms:

Ascend GPU