Answers.Body: <p>This is from my own experience with (Vanilla) GANs, so it might not translate exactly to your application, but maybe it gives some orientation.</p>
  <ul>
  <li>your learning rate seems quite high. I've quite frequently found that 1e-5 is a good value for me. The training might take longer but will probably be more stable.</li>
  <li>have you tried using dropout? It's a good regularisation mechanism that can prevent from overfitting and also make training more stable. I've made good experience with a dropout rate of ~0.4 and keeping it in both training and testing stages.</li>
  <li>what is your discriminator vs generator update ratio? In my experiments, ~5 discriminator updates per generator update has often shown to improve things.</li>
  <li>how many training samples do you have? If they are limited, it might be helpful to add a bit of noise on them. This manipulates the data a bit, but might make training more stable.</li>
  <li>I have often not seen a major change when varying the batch size.</li>
  <li>what are your network architectures? I have the feeling that small networks are often sufficient...</li>
  </ul>
  <p>This is entirely based on my own experience, but maybe there are some interesting directions for you to explore. Happy to hear back from you about the success of these tests.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-16T08:17:28.347Z
Answers.Text: Hi Mafu, thanks! (i) You're right, the LR of $1e-3$ seems to high.. Maybe I will restart training from scratch and see what it does. (ii) Interesting, I didn't know one could also use Dropout with GANs.. (iii) My critic (as for WGANs, we don't strictly have a discriminator) updates itself $5$-times before a generator update. (iv) I have enough training samles (more than $200$k images). (v) My network architectures are heavy, I won't deny that.. I oriented myself at this: https://github.com/aladdinpersson/Machine-Learning-Collection/blob/master/ML/Pytorch/GANs/4.%20WGAN-GP/model.py
Answers.UserDisplayName: Anonymous5638
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-16T02:59:41.847Z
Answers.LastActivityDate: 2021-03-16T02:59:41.847Z
Answers.UserDisplayName: Mafu
Body: <p>I am training a WGAN-GP network <a href="https://arxiv.org/pdf/1704.00028v3.pdf" rel="nofollow noreferrer">based on the following paper</a>, though I am using a different dataset. Now, for the first ~ 60-70 epochs, my network trained really well, which I could see in the loss going down, but I also made sure to regularly check the quality of the images.</p>
  <p>Unfortunately, what I am seeing now (for the last <span class="math-container">$20$</span> epochs) is that the generator is getting worse and worse, the images don't look that good anymore. I save checkpoints every epochs, so in principle, I could stop training and get myself a state of the network from where it was still performing quite okay.</p>
  <p>However, my question would be: How can I improve the training of the GAN? Would you decrease the learning rate?</p>
  <p>I use a batch size of 124 and a learning rate of 1e-3. Maybe I could/should continue training (with a checkpoint that was still quite okay) with a learning rate of 5e-4?</p>
  <p>Any other hints would be appreciated!</p>
  
Tags: <papers><generative-adversarial-networks><hyperparameter-optimization><implementation><wasserstein-gan>
Title: What to do with a GAN that trained well but got worse over time?
UserDisplayName: Anonymous5638
ThreadText: # What to do with a GAN that trained well but got worse over time?
  
  (Asked by: username_0 on 2021-03-15)
  
  I am training a WGAN-GP network [based on the following paper](https://arxiv.org/pdf/1704.00028v3.pdf), though I am using a different dataset. Now, for the first ~ 60-70 epochs, my network trained really well, which I could see in the loss going down, but I also made sure to regularly check the quality of the images.
  
  Unfortunately, what I am seeing now (for the last $20$ epochs) is that the generator is getting worse and worse, the images don't look that good anymore. I save checkpoints every epochs, so in principle, I could stop training and get myself a state of the network from where it was still performing quite okay.
  
  However, my question would be: How can I improve the training of the GAN? Would you decrease the learning rate?
  
  I use a batch size of 124 and a learning rate of 1e-3. Maybe I could/should continue training (with a checkpoint that was still quite okay) with a learning rate of 5e-4?
  
  Any other hints would be appreciated!
  
  **Tags:** papers, generative-adversarial-networks, hyperparameter-optimization, implementation, wasserstein-gan
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-03-16. Score: 1
  
  This is from my own experience with (Vanilla) GANs, so it might not translate exactly to your application, but maybe it gives some orientation.
  
  * your learning rate seems quite high. I've quite frequently found that 1e-5 is a good value for me. The training might take longer but will probably be more stable.
  * have you tried using dropout? It's a good regularisation mechanism that can prevent from overfitting and also make training more stable. I've made good experience with a dropout rate of ~0.4 and keeping it in both training and testing stages.
  * what is your discriminator vs generator update ratio? In my experiments, ~5 discriminator updates per generator update has often shown to improve things.
  * how many training samples do you have? If they are limited, it might be helpful to add a bit of noise on them. This manipulates the data a bit, but might make training more stable.
  * I have often not seen a major change when varying the batch size.
  * what are your network architectures? I have the feeling that small networks are often sufficient...
  
  This is entirely based on my own experience, but maybe there are some interesting directions for you to explore. Happy to hear back from you about the success of these tests.
  
  > **Comments:**
  > **username_0**: Hi Mafu, thanks! (i) You're right, the LR of $1e-3$ seems to high.. Maybe I will restart training from scratch and see what it does. (ii) Interesting, I didn't know one could also use Dropout with GANs.. (iii) My critic (as for WGANs, we don't strictly have a discriminator) updates itself $5$-times before a generator update. (iv) I have enough training samles (more than $200$k images). (v) My network architectures are heavy, I won't deny that.. I oriented myself at this: https://github.com/aladdinpersson/Machine-Learning-Collection/blob/master/ML/Pytorch/GANs/4.%20WGAN-GP/model.py  
  
  ---
  
  