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

Question about loss calculation in AR model without handling mask #185

Open
hertz-pj opened this issue May 27, 2024 · 1 comment
Open

Question about loss calculation in AR model without handling mask #185

hertz-pj opened this issue May 27, 2024 · 1 comment

Comments

@hertz-pj
Copy link

Regarding the loss calculation part of the AR model, why isn't the mask being handled?

total_loss = F.cross_entropy(logits, targets, reduction=reduction)

Normally, shouldn't it be:

total_loss = F.cross_entropy(logits.mask_selected(y_mask), targets.mask_selected(y_mask), reduction=reduction)

What's the reason for not considering the mask?

@oush7
Copy link

oush7 commented Jul 29, 2024

Regarding the loss calculation part of the AR model, why isn't the mask being handled?

total_loss = F.cross_entropy(logits, targets, reduction=reduction)

Normally, shouldn't it be:

total_loss = F.cross_entropy(logits.mask_selected(y_mask), targets.mask_selected(y_mask), reduction=reduction)

What's the reason for not considering the mask?

Hi, Did you understand why there is no mask in the ar loss?

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