从VAE中的正态分布中采样数据

时间:2017-09-28 22:59:51

标签: probability distribution normal-distribution autoencoder

我最近在阅读有关变分自动编码器的内容。在此方法中,z从正态分布中采样。我发现了一些现有代码,如下所示。

    eps = srng.normal((self.L, mu.shape[0], self.n_latent))
    # Reparametrize
    z = mu + T.exp(0.5 * log_sigma) * eps

https://github.com/y0ast/Variational-Autoencoder/blob/master/VAE.py#L107

        mean, var = args
        epsilon = K.random_normal(K.shape(mean))
        return mean+var*epsilon

https://github.com/rarilurelo/keras-VAE/blob/master/probability_distributions.py#L30

但我不确定这个公式是怎么来的。我可以想象使用mu,但我不知道第二次计算。我认为它来自数据的差异。你能描述一下这方面的更多细节吗?

0 个答案:

没有答案