Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

计算纵向泊松分布损失的注释与代码不一致 #5281

Closed
qinghe-jingxing opened this issue Nov 27, 2023 · 1 comment
Closed

计算纵向泊松分布损失的注释与代码不一致 #5281

qinghe-jingxing opened this issue Nov 27, 2023 · 1 comment

Comments

@qinghe-jingxing
Copy link

Describe the bug
在纵向联邦泊松分布损失的计算中,注释写的损失函数和实际代码计算的损失函数不同,注释的损失函数比代码和理论上的损失函数多计算了一次指数。

位置:hetero_poisson_gradient_and_loss.py第80行
详情: Compute hetero poisson loss:
loss = sum(exp(mu_g)*exp(mu_h) - y(wx_g + wx_h) + log(exposure))
loss函数中第一部分exp(mu_g)*exp(mu_h)
mu_g=exp(wx_g),第一部分就变成了exp(exp(wx_g))exp(exp(wx_h))
实际代码中 loss_mu = self.forwards.join(host_mu, lambda g, h: g * h).reduce(reduce_add),没有对mu_h和mu_g再计算指数。
因此代码注释可能是 loss = sum(mu_g
mu_h - y(wx_g + wx_h) + log(exposure))或 loss = sum(exp(wx_g)*exp(wx_h) - y(wx_g + wx_h) + log(exposure))

@nemirorox
Copy link
Contributor

多谢指正,我们计划在近期修改这部分注释代码,可以关注相关pr #5282

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants