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

[TTS] Fix off-by-1 bug in Beta Binomial Prior #4616

Merged
merged 1 commit into from
Jul 28, 2022
Merged

[TTS] Fix off-by-1 bug in Beta Binomial Prior #4616

merged 1 commit into from
Jul 28, 2022

Conversation

rlangman
Copy link
Collaborator

What does this PR do ?

Fix a bug in the prior calculation used in the TTS aligner

Collection: [TTS]

Changelog

  • Fix off-by-1 bug in prior calculation

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

Additional Information

The prior here is supposed to help the TTS model align by teaching it to place more weight on phonemes along the diagonal, with it always starting on the first phoneme and ending on the last phoneme.

The current logic produces a prior that looks like this, which awkwardly ends earlier than expected with maximum weight on the last phoneme before the end of the sequence:

image

After this change, the prior looks like this:

image

I think the intuition is that we model the attention as a binomial distribution (eg. coin flips with head being success, tail failure) where each success results in the attention moving on to the next phoneme. To reach the end of a sequence of N phonemes, you only need (N - 1) successes.

@rlangman rlangman requested review from XuesongYang and blisc July 26, 2022 19:38
@blisc
Copy link
Collaborator

blisc commented Jul 26, 2022

FYI @alancucki @rafaelvalle

@XuesongYang XuesongYang requested a review from redoctopus July 26, 2022 20:45
@rafaelvalle
Copy link

Very nice catch! Thank you!

Copy link
Collaborator

@redoctopus redoctopus left a comment

Choose a reason for hiding this comment

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

Dang, thanks for catching this! Approved.

Signed-off-by: Ryan <rlangman@nvidia.com>
@rlangman rlangman merged commit 2841c28 into main Jul 28, 2022
@rlangman rlangman deleted the prior_fix branch July 28, 2022 00:38
Davood-M pushed a commit to Davood-M/NeMo that referenced this pull request Aug 9, 2022
Signed-off-by: Ryan <rlangman@nvidia.com>
Signed-off-by: David Mosallanezhad <dmosallanezh@nvidia.com>
piraka9011 pushed a commit to piraka9011/NeMo that referenced this pull request Aug 25, 2022
Signed-off-by: Ryan <rlangman@nvidia.com>
Signed-off-by: Anas Abou Allaban <aabouallaban@pm.me>
hainan-xv pushed a commit to hainan-xv/NeMo that referenced this pull request Nov 29, 2022
Signed-off-by: Ryan <rlangman@nvidia.com>
Signed-off-by: Hainan Xu <hainanx@nvidia.com>
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.

4 participants