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

为什么交叉熵计算时目标标签都是0 #30

Open
AlonZhao opened this issue Jan 17, 2025 · 3 comments
Open

为什么交叉熵计算时目标标签都是0 #30

AlonZhao opened this issue Jan 17, 2025 · 3 comments

Comments

@AlonZhao
Copy link

zhiyu 你好,
label = torch.zeros(scores.shape[0], dtype=torch.long).to(scores.device) # why zeros?
irl_loss = F.cross_entropy(scores, label)
在计算损失函数时,交叉熵计算为什么设定label 标签都为零呢?

@SteveHao74
Copy link

同问这个问题

@HaoquanLiu
Copy link

Same question here.

@Jerome-Cong
Copy link

#5 I refer to the explanation here

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

4 participants