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

Why is a custom label smoothing used instead of CrossEntropy from torch? #106

Closed
janvainer opened this issue Nov 4, 2021 · 5 comments
Closed

Comments

@janvainer
Copy link

Torch CrossEntropy allows using label smoothing: https://pytorch.org/docs/stable/generated/torch.nn.CrossEntropyLoss.html

Is there any difference between the icefall implementation and the one provided by pytorch?

@csukuangfj
Copy link
Collaborator

The argument label_smoothing for torch.nn.CrossEntropyLoss is only available for torch >= 1.10

It is added in https://github.com/pytorch/pytorch/pull/63122/files#diff-6b8e21a44da970b14c1d62eb1747af1b09d3914ff1f6354754c62f1f5784cb9dR1107
on 2021-08-12, which is quite new.

@janvainer
Copy link
Author

I see, but otherwise the functionality should be the same, right?

@csukuangfj
Copy link
Collaborator

I have not checked that. Will read PyTorch's implementation tomorrow and come back later.

Thanks for pointing this out. I was not aware of this argument for torch.nn.CrossEntropyLoss.

@janvainer
Copy link
Author

Thanks, yeah this torch version is quite new. I found it by accident :)

@csukuangfj
Copy link
Collaborator

Is there any difference between the icefall implementation and the one provided by pytorch?

Please see #107

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