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

main.py第250行loss = criterion(outputs, y)-->loss = criterion(logits, y) #33

Closed
qianjinfighter opened this issue Jan 22, 2022 · 2 comments

Comments

@qianjinfighter
Copy link

你好,很感谢您的代码,我预测效果很差,多次修改损失函数都没有效果,看代码发现这里有点疑问,请问这里是不是错了?
man.py代码:
logits = torch.sigmoid(outputs)
labels = logits.clone()
labels[labels>0.5] = 1
labels[labels<=0.5] = 0
loss = criterion(outputs, y)#有问题?应该为loss = criterion(logits, y)

@MontaEllis
Copy link
Owner

没有问题

@qianjinfighter
Copy link
Author

啊 好的 谢谢

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

2 participants