pytorch-lightning-vae
pytorch-lightning-vae copied to clipboard
the value of loss is negtive
I found the value of loss became negtive when training the model in my dataset.I hope you can give me a help
I think the value of the loss is negative because in fact they are logging the negative elbo. Remember that elbo function is the evidence lower bound which is reconstruction loss - kl divergence. Since pytorch lightning does a minimization, they denote elbo with kl divergence - loss which is the opposite. In fact, you want to train the model using the original elbo function, that is, rec_loss - kl then you should maximize it. That's why you see the elbo in their implementation ends up being negative.