Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to interpret reconstruction loss of VAE #2

Open
imtiendat0311 opened this issue Mar 13, 2024 · 0 comments
Open

How to interpret reconstruction loss of VAE #2

imtiendat0311 opened this issue Mar 13, 2024 · 0 comments

Comments

@imtiendat0311
Copy link

Hi i'm Dat Nguyen CS student who currently research on VAE and detect underlying pattern of single cell data. I did review your code and notice you have similar way of calculate loss of VAE.

Pytorch code

reproduction_loss = nn.functional.mse_loss(x_hat, x, reduction='none').sum(dim=1).mean()
KLD = torch.mean(-0.5 * torch.sum(1 + log_var - mean **
                     2 - log_var.exp(), dim=1), dim=0)

But the problem for this is reproduction_loss is too big since we only reduce it to mean ( batch size )

So my question is how could you interpret those loss and make sure that the model going to correct direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant