AntixK / PyTorch-VAE

A Collection of Variational Autoencoders (VAE) in PyTorch.
Apache License 2.0
6.44k stars 1.05k forks source link

The reconstructed image looks okay, but the sampling results are very poor #88

Open JaosonMa opened 5 months ago

JaosonMa commented 5 months ago

i used the VanillaAE, used all the celeba img_align_celeba data, 200k this is epoch 28 reconstructed image: 28_2000_re this is epoch 28 sample image: 28_2000

i think the sample was very bad, how can it happen?

brockbrownwork commented 5 months ago

It's possible that you're overfitting. I just posted an issue about this, but I think the convolutional layers are supposed to get fewer channels toward the middle because it's an autoencoder, not more channels in the middle. Try reversing hidden_dims maybe and train again.

Edit: never mind, I missed the fact that there's a stride of two, so it does create a bottleneck in the middle. Also apparently increasing the channels toward the middle isn't uncommon.

image