Giter VIP home page Giter VIP logo

Comments (5)

knazeri avatar knazeri commented on September 7, 2024 2

@amjltc295 Thank you for your interest in our work.

  1. All different GAN losses are still active and being used by the community and each has its own merits. Minimizing the original GAN loss is shown to be equal to minimizing Jensen-Shannon divergence. But it works poorly on early iterations due to small gradient and is very unstable when both networks become more powerful, again due to large gradients! The NSGAN, or the non-saturating version of GAN, is a heuristic solution to the problem by changing the problem from minimizing the log probability of the correct answer to maximize the log probability of the wrong answer!
    The LSGAN, or least squares GAN, is shown to be equal to minimizing the f-divergence! This loss function is also more robust to mode collapse! In our experiments, we found NSGAN to converge faster, and our model is not susceptible to mode collapse due to conditioning partially on input edge maps. That's why we used NSGAN in all experiments!
    The Hige loss version of GAN is a new player in town! We just implemented it and didn't really experiment with it until recently! This loss function works great in the presence of spectral normalization module! In our recent experiments, although converges slower, this loss function produces much sharper edges and results in much better precision and recall for the edge maps!

  2. All pre-trained weights are trained with NSGAN. We will be releasing a new set of weights once we complete our new experiments.

  3. The loss values that you are getting are normal. GAN in a way is a min-max game, which means losses will oscillate around some values. In a way, that's what you want: two players both getting stronger together. If one of the networks becomes much stronger then the other, learning stops and you'll see unbalance loss values. The learning curve of GAN loss is expected to be flat line with lots of oscillation around its mean! It's better to monitor some other performance measure to validate the quality/learning of the procedure!

from edge-connect.

amjltc295 avatar amjltc295 commented on September 7, 2024

Thanks for your detailed reply :)

from edge-connect.

tengshaofeng avatar tengshaofeng commented on September 7, 2024

dear, @knazeri . you really did a great job.
look at line 106 and line 115 code in models.py when training edge generator.
"dis_input_fake = torch.cat((images, outputs.detach()), dim=1)... dis_fake, dis_fake_feat = self.discriminator(dis_input_fake)"
and " gen_input_fake = torch.cat((images, outputs), dim=1)... gen_fake, gen_fake_feat = self.discriminator(gen_input_fake)"
I think gen_fake_feat is same as dis_fake_feat, why repeat compute that?
look forward your reply.

em. the difference is the detach(), so they are not same. then when update discriminator, generator's params is fixed, but when update generator params, discriminator is also updated. Is it right?

from edge-connect.

tengshaofeng avatar tengshaofeng commented on September 7, 2024

dear, @knazeri . you really did a great job.
look at line 106 and line 115 code in models.py when training edge generator.
"dis_input_fake = torch.cat((images, outputs.detach()), dim=1)... dis_fake, dis_fake_feat = self.discriminator(dis_input_fake)"
and " gen_input_fake = torch.cat((images, outputs), dim=1)... gen_fake, gen_fake_feat = self.discriminator(gen_input_fake)"
I think gen_fake_feat is same as dis_fake_feat, why repeat compute that?
look forward your reply

from edge-connect.

cats-food avatar cats-food commented on September 7, 2024

@tengshaofeng I don't think so.
When updating D, outputs.detach is used to cut off the gradient flow so that G could be fixed in this way.
While updating G, despite parameters in D partly contribute to the gen_loss term, the update step self.gen_optimizer.step() is defined as follows:

self.gen_optimizer = optim.Adam(
    params=generator.parameters(),       
    lr=float(config.LR),
    betas=(config.BETA1, config.BETA2)
)

this suggests that only parameters in G will be updated via Adam optimizer.

from edge-connect.

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.