jeffheaton / t81_558_deep_learning

T81-558: Keras - Applications of Deep Neural Networks @Washington University in St. Louis
https://sites.wustl.edu/jeffheaton/t81-558/
Other
5.71k stars 3.04k forks source link

GAN Resolution #35

Closed jeffheaton closed 4 years ago

jeffheaton commented 4 years ago

This was submitted to me in email, adding here so I do not lose track of the request.

I did encounter a problem when trying to run the GAN through COLAB with an image res of 96 or 128.

The problem starts when I try to start the training. If the Image_res is set to 3, we will generate training data with a resolution of 96, however, the training block at the bottom gives an error, as it expects data with a resolution of 128. The same happens with image_res set to 4, generate data of 128 res, training expects 256. If I set image_res to 1 or 2, there are no problems, the expected resolutions of 32 and 64 respectively are returned in the training block. I think that the training block uses a different formula for the expected data, based on the image_res constant we provide, then the resolution we define (generate_square).

The current definition for our image resolution is 32 image_res. I believe the training block uses the following definition 32 2^(image_res-1). This formula has the same result as our current definition for image_res 1 and 2, and outputs a resolution of 128 and 256 for an image_res of 3 and 4 respectively.

When I tried altering the generate_square formula from 32 image_Res to 32 ( 2 ** (Image_res - 1 ) ) it resolved the issue and allowed me to run the training block for images with a 128 resolution, with image_res set to 3.

As I have no knowledge of the source code or the programming language, I'm not 100% that this is the correct solution. I just wanted to inform you about this issue.

Thank you again for the fantastic lectures on youtube and the availability of the lessons on Github. Kind Regards.

balajib363 commented 4 years ago

Hello, Even I am facing exactly the same issue. Can anybody guide me with the appropriate solution for it?? My generator accuracy is too bad for a custom dataset. And here while training the input dataset can be any resolution irrespective of what output we generate??? Thanks

jeffheaton commented 4 years ago

I am reworking much of the GAN code right now for full 2.0 compatibility, I will address this as well very soon.

jeffheaton commented 4 years ago

There was an issue here, this should be fixed with my 2.0 redesign. Of course, if you push the resolution considerably higher, you may need to adjust the network structure to be able to account for it, or it may fail to converge. But you should not see an error like was reported here.