Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

Can i use two kinds of loss_layer such as multibox_loss_layer and sum_cost ?

Open youngstu opened this issue 8 years ago • 11 comments

Thank you for contributing to PaddlePaddle. Submitting an issue is a great help for us. Both Chinese and English issues are welcome.

It's hard to solve a problem when important details are missing. Before submitting the issue, look over the following criteria before handing your request in.

  • [ ] Was there a similar issue submitted or resolved before ? You could search issue in the github.
  • [ ] Did you retrieve your issue from widespread search engines ?
  • [ ] Is my description of the issue clear enough to reproduce this problem?
    • If some errors occurred, we need details about how do you run your code?, what system do you use?, Are you using GPU or not?, etc.
    • If you use an recording asciinema to show what you are doing to make it happen, that's awesome! We could help you solve the problem more quickly.
  • [ ] Is my description of the issue use the github markdown correctly?
    • Please use the proper markdown syntaxes for styling all forms of writing, e.g, source code, error information, etc.
    • Check out this page to find out much more about markdown.

youngstu avatar Feb 09 '18 09:02 youngstu

can you give some more information about your question?

jacquesqiao avatar Feb 09 '18 09:02 jacquesqiao

If i use two kinds of loss_layer, total loss is sum of them?(or add in proportion) And gradients is how to update ?

youngstu avatar Feb 09 '18 09:02 youngstu

two branches and two tasks and two losses

youngstu avatar Feb 09 '18 09:02 youngstu

are you using Python V2 API?

jacquesqiao avatar Feb 09 '18 09:02 jacquesqiao

v1

youngstu avatar Feb 09 '18 09:02 youngstu

paddle python v2 can support?

youngstu avatar Feb 09 '18 09:02 youngstu

If Python V2 API support the demand, i can update paddle to v2.

youngstu avatar Feb 09 '18 10:02 youngstu

https://github.com/PaddlePaddle/Paddle/issues/2913#issuecomment-315690936

当指定多个损失函数时,日志中的输出是把多个损失函数求和。https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/trainer/TrainerInternal.cpp#L137 cost = Argument::sum(*outArgs); 上面代码中 outArgs 就是配置中指定的一个或者多个损失函数,Paddle 目前不会分别输出每个损失函数的值。

jacquesqiao avatar Feb 10 '18 05:02 jacquesqiao

如果使用fluid的话,多个loss可以使用add operator进行组合

jacquesqiao avatar Feb 10 '18 05:02 jacquesqiao

Closing due to low activity. Feel free to reopen it.

peterzhang2029 avatar Mar 10 '18 03:03 peterzhang2029

@peterzhang2029 can you reopen this issue? I want to know how to achieve it.

chenbblei avatar Apr 25 '18 12:04 chenbblei