question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Losses are not correct

See original GitHub issue

There is a problem with calculate_3d_loss in tensorflow_tts.utils.strategy.

The mel ground truth (y_gt) should not be truncated if the mel prediction (y_pred) is shorter. If the prediction is shorter, it should be penalized. One way to do this is to pad the prediction to the ground truth length.

In practice, this rarely happens, because stop_token_loss is wrongly set up and usually causes the model produce output longer than the ground truth. This is also due to truncated y_pred in calculate_2d_loss. Consider the following, where max_mel_length = 3:

stop_token_predictions = [-20, -20, -20, -20, -20, -20, 5, 5, 5, 5]
stop_gts = [0, 0, 0]

Truncating stop_token_predictions will make loss close to 0, although the stop token prediction is totally wrong (it should stop after 6 mel slices, not 3). To make it right, stop_gts should be padded with 1s.

There also needs to be masking in the loss functions, and the training can be a lot faster if we use bucket_by_sequence_length for batching the dataset. I’m currently implementing these.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
dathudeptraicommented, Oct 14, 2021

@iamanigeeit hi, tacotron2 use teacher forcing so the len of y_gt and y_pred are also equal 😄

0reactions
stale[bot]commented, Dec 26, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Taxpayers Lose when Losses are Lost - Baker Newman Noyes
Conclusion. Taxpayers generally are correct in thinking that some losses will lower their taxes. However, many different types of losses exist, ...
Read more >
Solved Which of the following statements about net income
Question: Which of the following statements about net income and net losses is not correct? Net income implies that revenues are greater than...
Read more >
Topic No. 409 Capital Gains and Losses - IRS
You have a capital gain if you sell the asset for more than your adjusted basis. You have a capital loss if you...
Read more >
Capital Gains and Losses - TurboTax Tax Tips & Videos - Intuit
A capital loss is a loss on the sale of a capital asset such as a stock, bond, mutual fund or investment real...
Read more >
Application of the Tax Basis and At-Risk Loss Limitations to ...
Assume that the allocation to A in this example is valid because A has a ... 704(d), A may not deduct any of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found