Project-MONAI / GenerativeModels

MONAI Generative Models makes it easy to train, evaluate, and deploy generative models and related applications
Apache License 2.0
600 stars 87 forks source link

Tutorial about adaptative weights for adversarial training #144

Open Warvito opened 1 year ago

Warvito commented 1 year ago

In the original code from taming transformers and latent diffusion models, the weight for the discriminator adversarial loss is defined by the ratio between the nll_loss and the g_loss gradients (https://github.com/CompVis/taming-transformers/blob/3ba01b241669f5ade541ce990f7650a3b8f65318/taming/modules/losses/vqperceptual.py#L63).

In our experiments and the paper on 3D brain images (https://arxiv.org/pdf/2209.07162.pdf), we were not able to make it work well on both, 2D and 3D data. However, this might be useful for others.

danieltudosiu commented 1 year ago

We have the code for it in the KCL's VQ-VAE codebase