Giter VIP home page Giter VIP logo

Comments (6)

hfslyc avatar hfslyc commented on May 26, 2024

loss_adv_p is essentially the inverse loss of loss_D. We expect them to achieve a good balance during the adversarial training. Please refer to equation (1) and (4) in our paper. We use lambda_adv to control the balance point between loss_adv_p and loss_D. Does that answer your question?

from advsemiseg.

John1231983 avatar John1231983 commented on May 26, 2024

Great. You have mentioned that your task tries to minimize loss_D and maximize loss_adv_p. However, when we maximize loss_adv_p, the loss_seg_total = loss_seg+ lambdax loss_adv_p in ep (2) tends to increase. But we want to minimize the eq (2). Does it make sense?

One more thing, your implementation use
You used

for param in model_D.parameters(): 
     param.requires_grad = False 
loss = loss_seg + args.lambda_adv_pred * loss_adv_pred 
loss.backward() 

Does it same as the below?

loss = loss_seg + args.lambda_adv_pred * loss_adv_pred 
loss_seg.backward() 

By delete the first two lines and change loss.backward() to loss_seg.backward()because loss_adv_pred does not do backward() so D not trained.

from advsemiseg.

hfslyc avatar hfslyc commented on May 26, 2024

from advsemiseg.

John1231983 avatar John1231983 commented on May 26, 2024

Thanks. I have updated something in the above question related to implementation. Could you also look at it? Thanks for your answer

from advsemiseg.

hfslyc avatar hfslyc commented on May 26, 2024

No. It's not equivalent. By doing that you are not performing the adversarial training since you are not minimizing loss_adv.

from advsemiseg.

John1231983 avatar John1231983 commented on May 26, 2024

@hfslyc : Thanks. I have one more question. In my case, the both loss_adv_p and loss_D are decreasing. What does happen in my case? Do we expect that loss_adv_p increases and loss_D decrease?

from advsemiseg.

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.