Code Monkey home page Code Monkey logo

Comments (5)

xinntao avatar xinntao commented on September 13, 2024 3

Hi @Jing25
D_fake: The mean of D outputs for fake ones (generated SR images)
D_real: The mean of D outputs for real ones (GT)
l_d_fake: D loss for fake ones (generated SR images)
l_d_real: D loss for real ones (GT)
l_g_fea: G loss (feature loss, e.g., percetual loss)
l_g_gan: G loss (adversarial loss )
l_g_pix: G loss (pixel loss)
Run the codes, and get their values.

You may also need to change
"which_model_G": "RRDB_net" // RRDB_net | sr_resnet
in the test_esrgan.json.

from basicsr.

Jing25 avatar Jing25 commented on September 13, 2024

How can I test SRGAN with your code? In the test_esrgan.json file, I changed "model" into "srgan" and "pretrain_model_G" into "SRGAN_bicx4_303_505.pth". But there's error.

from basicsr.

Jing25 avatar Jing25 commented on September 13, 2024

If D_fake/D_real is the mean of D outputs fake/real, then I guess the expected optimal value of each of them should be 0.5?
I think G loss (l_g_fea, l_g_gan and l_g_pix) should decrease with number of iteration increasing. How about D loss (l_d_fake and l_d_real)?

Yeah. I change "which_model_G" to "sr_resnet" and then "nb" to 16. It works. But I'm just curious why I cannot change "norm_type": null to "batch"? SRGAN uses batch normalization. But why here if I change "norm_type" to "batch" it has error?

from basicsr.

xinntao avatar xinntao commented on September 13, 2024
  1. In vanilla GAN, the mean of D outputs measures the realness or fakeness of the inputs. Thus, in theory, the D_fake and D_real should converge to both 0.5 (See https://arxiv.org/pdf/1406.2661.pdf ). However, in practice, this is not the case. For example, you can find the D outputs for DCGAN in https://github.com/carpedm20/DCGAN-tensorflow, where D_real approaches to 1 and D_fake approaches to 0.
    Furthermore, the outputs of D are not necessarily the scores of realness or fakeness.
    In ESRGAN, we use Relativistic GAN, where the discriminator predict
    relative realness instead of the absolute value. The meaning of D outputs is not clear.

I attached one example for ESRGAN, D_real and D_fake are the values before sigmoid.
image

  1. The SRGAN model we provided is different from the official one. We also omit the BN layers and do some slight changes. But the main ideas -- using ResNet stucture, vgg+adv loss, are the same.

from basicsr.

Jing25 avatar Jing25 commented on September 13, 2024

Thank you for the explanation. It helps a lot.

from basicsr.

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.