lucidrains / lightweight-gan

Implementation of 'lightweight' GAN, proposed in ICLR 2021, in Pytorch. High resolution image generations that can be trained within a day or two
MIT License
1.62k stars 220 forks source link

Loss functions of every step #65

Open MartimQS opened 3 years ago

MartimQS commented 3 years ago

I have noticed that the loss functions and evaluation values fluctuate a lot and I wonder if the optimal number of steps isn't smaller than the 150000 by default. How can I get the information that is provided in each step to a csv file? Has anyone done this already?

Mut1nyJD commented 3 years ago

Losses in GANs fluctuate all the time you have to look at the long duration as over a short period they don't tell you anything, So if the magnitude in general does decline slowly if it instead goes up and up over time then you have a problem.

MartimQS commented 3 years ago

Yes, that’s what I had in mind and the it is reason why I wanted to log the values for the losses and take a look at the development of the values over time to see how they behave

radeonthe1st commented 3 years ago

I'm quite a newbie at GitHub so I'm not sure if doing this is right, but I would like to poke this issue, since this is a problem I'm having right now. I need to be able to log the progress of the GAN so that I can at least plot it.

Any idea on how to get this done?

jonas-klesen commented 3 years ago

I'm quite a newbie at GitHub so I'm not sure if doing this is right, but I would like to poke this issue, since this is a problem I'm having right now. I need to be able to log the progress of the GAN so that I can at least plot it.

Any idea on how to get this done?

Probably best to use tensorboard:

  1. Clone repo, make sure you can run the code from the source
  2. install tensorboard with pip or conda
  3. import tensorboard at the top of the lighweight_gan.py file
  4. Add your logging code here (i think): https://github.com/lucidrains/lightweight-gan/blob/49c4b274f21e2f41108e9de7bd5ecde92703e40d/lightweight_gan/lightweight_gan.py#L1213
  5. Start tensorboard from terminal and open it in the browser (you can find plenty of info online)

All the best in your voyages!