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

[Wav2Vec2, Hubert] Fix ctc loss test #12458

Merged
merged 7 commits into from
Jul 1, 2021

Conversation

patrickvonplaten
Copy link
Contributor

What does this PR do?

This PR fixes the ctc_loss test. The problem is that PyTorch ctc_loss implementation https://pytorch.org/docs/stable/generated/torch.nn.CTCLoss.html seems to use too many approximation to ensure deterministic behavior for a test. So in the PR I make the test much less aggressive by simply checking that the loss can be computed.

We've trained 250 models during the Wav2Vec2 sprint using this function so I think we can be quite certain that it works as expected.

Not an ideal solution, but I don't really see how to make this "sum == mean" test really work since it's so flaky

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LysandreJik LysandreJik merged commit 27d348f into huggingface:master Jul 1, 2021
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

Successfully merging this pull request may close these issues.

2 participants