Closed sbagchi12 closed 6 years ago
You want the function sample_trained_model
in model.py
(https://github.com/ratschlab/RGAN/blob/master/model.py#L324). You need to provide the identifier of the experiment (or a path to the settings file you used to run it) and the epoch you want to sample from, as well as how many samples:
sample_trained_model(settings, epoch, num_samples)
Thanks for the help. I have been able to generate 6 samples from epoch 99. However, the generated images do not look like original digits but look like some kind of a graph. Is there any settings for this or the training was not good? I have used the view_digit function in eval.py. Thanks for the help in advance.
Could you please share the settings file for reproducing the MNIST results reported in the paper with RGAN with 28*28 images?
Hello,
I tried running the code by simply using the test.txt file provided using the following the command: python experiment.py --settings_file test
It worked, but I was checking the plots generated at every epoch. What should I infer from these, because it does not look like it is able to generate the MNIST digits. For instance, this is what I get at epoch 99:
Can you please clarify on the results I am getting? Thank you!
@sbagchi12 here's the settings file: https://github.com/ratschlab/RGAN/blob/master/experiments/settings/mnistfull.txt You may need to double check that the data load function is loading in the 28x28 mnist, after we started working on the 14x14 mnist we mostly stuck with it, so the 28x28 is slightly 'legacy' by now unfortunately.
@radaimi Training GANs is fairly tricky and you need to carefully tune hyperparameters - the test.txt settings file is just a sample of what the options are, and the hyperparameters it contains are probably not optimal for generating MNIST. You can take a look at the settings in the file I linked above, or perhaps in this one: https://github.com/ratschlab/RGAN/blob/master/experiments/settings/cristobal_mnist.txt which gives the parameters we used to generate MNIST digits using the RCGAN (the conditional case).
Thank you so much! Can I ask how did you go about tuning the hyperparameters?
@radaimi Unfortunately, a lot of trial and error with some staring at loss traces... for tuning how many rounds of discriminator and generator to do, (D_rounds
and G_rounds
) you can see if perhaps the discriminator or generator loss is decreasing too quickly (so reduce the number of rounds it gets). If you have a lot of computational resources at hand, you can set a bunch of different settings running and then see what seems to work (we did a bit of that). Or trying to build intuition by just varying a single hyperparameter at a time, or setting it to extreme values, etc.
I have trained a new RGAN model using MNIST data. What are the steps to generate images from the trained model?