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

loss这里设计的是不是有问题? #59

Open
AiAiGhost opened this issue Aug 26, 2021 · 4 comments
Open

loss这里设计的是不是有问题? #59

AiAiGhost opened this issue Aug 26, 2021 · 4 comments

Comments

@AiAiGhost
Copy link

weight_attribute = torch.sum(attributes_w_n.mul(mat_ratio), axis=1)
loss里乘这一项导致没有特殊属性的人脸loss值为0,就是正常的人脸在训练里面的贡献为0,这样的设计正确么?还是我理解有误?

@Rayson2020-8
Copy link

我也发现了这个问题,很奇怪

@Rayson2020-8
Copy link

image
这个项目作者复现错了,去看了tensorflow的项目,那里最后是使用weighted_loss + l2 loss = total loss进行backward,而不是单单使用weighted_loss,两者加起来才合理。

@qmcreeper
Copy link

没记错的话torch.cos()期望输入是弧度,数据貌似是角度,直接输入本身有点问题。另外预测值和真实值理论范围是(-inf,+inf),再加上余弦函数是周期函数,也就是说只要误差接近(1+T)pi损失值weighted_loss会非常接近0

@Rayson2020-8
Copy link

Rayson2020-8 commented Dec 16, 2022 via email

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