Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A kind request for the code implementation for SRResNet #40

Open
BassantTolba1234 opened this issue Nov 28, 2020 · 1 comment
Open

A kind request for the code implementation for SRResNet #40

BassantTolba1234 opened this issue Nov 28, 2020 · 1 comment

Comments

@BassantTolba1234
Copy link

Please all,
I need the code of implementation this part
the part is

{The SRResNet networks
were trained with a learning rate of 10−4 and 106 update
iterations. We employed the trained MSE-based SRResNet
network as initialization for the generator when training
the actual GAN to avoid undesired local optima.{

@neilthefrobot
Copy link

To successfully train SRGan you must start it out with an already trained SRResNet. Otherwise you will see your generator/discriminator losses very high and stuck in a local minima right off the start. The network will still end up being able to improve image quality, but it will be only from the VGG loss and the GAN part will be basically useless.
The fix is extremely easy. In "get_gan_network" change the compilation to be

gan = Model(gan_input, x) 
gan.compile(loss='mse', optimizer=optimizer)

and in the training loop just comment out the training of the discriminator.
This trains the generator to minimize the MSE between the training inputs and the training targets with no GAN.
Once this model is trained, removed these changes and continue training (using VGG perceptual loss + GAN loss and training the descriminator in the training loop)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants