AMLab-Amsterdam / DIVA

Implementation of 'DIVA: Domain Invariant Variational Autoencoders'
MIT License
98 stars 19 forks source link

The dimensions of the reconstrcted image of MNIST should be permuted before caculating losses. #4

Open Xinyi-1022 opened 2 years ago

Xinyi-1022 commented 2 years ago

DIVA/paper_experiments/rotated_mnist/supervised/model_diva.py The output of px is x_recon with the shape of [100, 256, 28, 28] (Line 39). It should be permuted to [100, 28, 28, 256], because x_recon = x_recon.view(-1, 256) was applied before caculating the reconstruction loss. (Line 371) After the correction, the noise of the reconstructions is less.

Xavier-MaYiMing commented 2 years ago

Sounds reasonable.

DCruss commented 2 years ago

In your article,u have mentioned"Since our main goal is a domain invariant classifier, during inference we only use the encoder qφy (zy|x) and the auxiliary classifier qωy (y|zy)."But in your code or your final loss,u regard auxiliary multiplier y and auxiliary multiplier d as the same one.In the other word,where u reflect the Domain Invariant?