vae.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:pyro 作者: uber 项目源码 文件源码
def forward(self, x):
        # define the forward computation on the image x
        # first shape the mini-batch to have pixels in the rightmost dimension
        x = x.view(-1, 784)
        # then compute the hidden units
        hidden = self.softplus(self.fc1(x))
        # then return a mean vector and a (positive) square root covariance
        # each of size batch_size x z_dim
        z_mu = self.fc21(hidden)
        z_sigma = torch.exp(self.fc22(hidden))
        return z_mu, z_sigma


# define the PyTorch module that parameterizes the
# observation likelihood p(x|z)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号