-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add alphas to control language and speaker balancer #1216
Conversation
Hi @Edresson . I am not sure to fully understand the logic. |
In this way, we can control the language and speaker influence. In this case ( language_alpha = 10 and speaker_alpha = 1), language will generate the highest weights and speaker small ones. During the sample selection in a language X, a speaker with few samples will have more probably to be chosen than a speaker with more samples, however, we will keep the language balancer intact (because it has a high alpha). In theory, the alphas can be used to create levels of balancing. Balancers with the highest alphas will have priority (in this case language). |
c7b6b5f
to
525eb93
Compare
I like the idea of computing weights and then sampling 👍 |
I am about to make formatters return List[Dict], I guess your changes are affected by that too. So maybe we wait until I push those changes and rebase this PR. |
24c0511
to
ee61689
Compare
@Edresson sorry to revive this discussion but the 0.6.2 is about to be merged including this. as is, let say we have a very abnormal distribution of speakers, eg: a few speakers with very little number of samples. Those will be balanced with a probability which is the same as another speaker with a huge amount of data. Am I correct ? |
Yeah, the objective of the speaker balancer is that all speakers appear in a similar frequency in the batch. If the user has noisy speakers he needs to remove these speakers from the dataset. Unfortunately, we can't control it :(. |
Well somehow it is a change in behavior I think vs previous version, so might be good to be specific in the doc. |
By default use_speaker_weighted_sampler and use_language_weighted_sampler are disable. So if the user does not enable it, no change exists between the versions :). The only thing that this PR, changes is that currently, we can enable the language weighted sampler and the Speaker weighted sampler together (and use multiples GPUS with these samplers). |
This PR fixes the issue/suggestion reported in #1185 .
It permits the combination of weights for speaker and language balance. I normalize the language and speaker weights and added an independent alpha for each one.I performed the sum of the weights multiplied by the respective alphas of language and speaker balancer. In this way, we can control the influence of speaker and language in the batch balancer and easily add a new balancer if necessary in the future.