Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

请问huber_regression_cost支持weight加权吗?如果不支持的话,有什么办法可以像mse_cost一样对样本进行加权吗?

Open zyz282994112 opened this issue 8 years ago • 9 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.

zyz282994112 avatar Sep 14 '18 03:09 zyz282994112

你是指 Paddle v2 版本的 huber_regression_cost 吗? 如果是的话, 那只支持通过 coeff 传入参数对反向传递的梯度进行加权, 不支持其他加权方式了

velconia avatar Sep 17 '18 07:09 velconia

你好, 请问还有别的问题吗?

velconia avatar Sep 17 '18 12:09 velconia

你是指 Paddle v2 版本的 huber_regression_cost 吗? 如果是的话, 那只支持通过 coeff 传入参数对反向传递的梯度进行加权, 不支持其他加权方式了

嗯嗯,Paddle v2 版本的 huber_regression_cost。补充下背景:我这边问题类似ctr预估,想用点击次数对样本进行加权,如果不支持weight的话,那有什么合适的加权方式呢?(ps:点击量比较大,按点击量视为多条样本的话,数据量太大)

zyz282994112 avatar Sep 18 '18 03:09 zyz282994112

通过 coeff 传入参数对反向传递的梯度进行加权, 这个特性符合你的需求吗?

velconia avatar Sep 18 '18 06:09 velconia

通过 coeff 传入参数对反向传递的梯度进行加权, 这个特性符合你的需求吗?

是指coeff直接用点击量吗?会不会太大啊?

zyz282994112 avatar Sep 18 '18 06:09 zyz282994112

可以对点击量做一定的平均, 例如除以方差或者数量等

velconia avatar Sep 20 '18 07:09 velconia

可以对点击量做一定的平均, 例如除以方差或者数量等

可是每个样本的点击量都不一样,而coeff这个参数只支持float/int/long格式,不支持向量。做完cost后再乘上点击量加权可以吗?如下: cost = paddle.layer.huber_regression_cost(input=output, label=acp, delta=2.0) cost = paddle.layer.scaling(cost, weight)

ps:我的paddle版本为v2版本

zyz282994112 avatar Sep 28 '18 07:09 zyz282994112

做完cost之后不行了,建议对点击量进行一定操作之后再传给coeff, 比如 除以方差或者数量等

velconia avatar Oct 10 '18 10:10 velconia

您好,此issue若已经解决,我们将于三天内关闭。若在关闭后您仍需跟进提问,可重新开启此问题, 我们将在24小时内回复您。因关闭带来的不便我们深表歉意,请您谅解~感谢您对PaddlePaddle的支持!

lucywsq avatar Oct 26 '18 06:10 lucywsq