Coder Social home page Coder Social logo

Comments (11)

sanghyun-son avatar sanghyun-son commented on August 27, 2024 2

Hello.

I tested MDSR-GAN and got satisfying results.

You have to change some codes for this experiment.

These two lines should be replaced to

tp = patch_size

if you want to train MDSR-GAN.

Also, I used a script below:

python main.py --template GAN --model MDSR --scale 2+3+4 --save MDSR_GAN --reset --patch_size 96 --loss 5*VGG54+0.15*GAN --pre_train ../experiment/model/MDSR_baseline.pt --ext bin --save_results --data_test Set14

Also, my WGAN-GP implementation is valid.

However, I do not think that it is appropriate to directly use WGAN-GP formulation to super-resolution.

If I found nice approach, I will let you know.

Thank you!

from edsr-pytorch.

sanghyun-son avatar sanghyun-son commented on August 27, 2024 1

You can train MDSR_baseline with adversarial loss.

However, there is one thing to be changed from the code.

Currently, MDSR is designed to take 48x48 input patches for all scales, and returns 96x96, 144x144, and 192x192 output patches.

Because GAN discriminator should take 96x96 patches as its input, it is better to change the input patch-size for different scales (ex. 48x48 for scale 2, 32x32 for scale 3, and 24x24 for scale 4.)

Another approach is to use global-average pooling at the end of the discriminator to make scale-independent model.

If you are not in hurry, I will test and upload the script.

Thank you!

from edsr-pytorch.

sanghyun-son avatar sanghyun-son commented on August 27, 2024 1

You can download it from here.

I think x4 output is not that satisfying with my default hyper-parameters.

Maybe they can be better if you use smaller weight to adversarial loss (--loss 5*VGG54+0.1*GAN seems to be appropriate.), or changing other parameters.

Thank you!

from edsr-pytorch.

sanghyun-son avatar sanghyun-son commented on August 27, 2024

Hello.

I think answers below can help you.

  1. I think batch-normalization 'can' be removed, but that is not a mandatory.

  2. These lines control the hyperparameters of the generator (SR network) optimizer. You can change them with input arguments. (ex. python main.py --lr 5e-5) You can modify the discriminator optimizer's hyperparameters by fixing these lines, if you are using WGAP-GP configuration. They are hard-coded. In case of using GAN and WGAN loss, both generator and discriminator share their optimizer's hyperparameters.

  3. Use --gan_k [n] argument to modify it.

  4. You can refer to this line, to check how you set the loss function.

Although I implemented WGAN loss and checked it working, there are several things to consider.

  1. In the original WGAN-GP paper, authors set --gan_k to 5, but it takes so much time as the output patch_size is 192x192 or 96x96 in my default setting.

  2. If gan_k is larger than 1, you require multiple output batches to update the discriminator several times. This is not a big problem in the traditional generative model(like DCGAN) because they generate images from multi-dimensional uniform or normal distributions, which can be generated any time you want. However, super-resolution network have to take low-resolution patches as input, and they should be sampled from dataset. Until now, the adversarial loss function class do not access to the dataset, and I use a single batch to update the discriminator gan_k times. I am not sure on this approach.

  3. Code can be executed, but it does not seem to converge.

For these reasons, I recommend you to use naive GAN as SRGAN did. You can do this by running this line.

Thank you!

from edsr-pytorch.

gentleboy avatar gentleboy commented on August 27, 2024

Thank you for detail and clear answers.

In addition, I would also like to ask if MDSR_baseline can be trained with naive GAN? If the answer is yes, how should I do it?

Thank you!

from edsr-pytorch.

gentleboy avatar gentleboy commented on August 27, 2024

Thank you for your reply. I am looking forward to your test results.

In addition,for EDSR_baseline_x4, I'm curious whether using WGAN-GP will get better performance than naive GAN? I don't have enough ability to implement WGAN-GP correctly now,can you take some time to test WGAN-GP?

Thank you very much!

from edsr-pytorch.

gentleboy avatar gentleboy commented on August 27, 2024

Can you send me a copy of the trained MDSR-GAN model? I want to see its super-resolution results.

My email address is: [email protected]

Thank you!

from edsr-pytorch.

gentleboy avatar gentleboy commented on August 27, 2024

Thank you!

from edsr-pytorch.

Jasas9754 avatar Jasas9754 commented on August 27, 2024

https://github.com/JustinhoCHN/SRGAN_Wasserstein

이후에 이런 레포가 생겼네요. 참고할 수 있을거 같습니다.

from edsr-pytorch.

Jasas9754 avatar Jasas9754 commented on August 27, 2024

And what about wgan-hinge https://arxiv.org/abs/1803.01541

Is it a waste of time? I'm curious about the result.

from edsr-pytorch.

sanghyun-son avatar sanghyun-son commented on August 27, 2024

I think every experiment is worth trying.

However, I do not have enough time for implement advanced WGANs, so it will very nice if someone make a pull request.

Thank you for letting me know those ideas!

from edsr-pytorch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.