-
Notifications
You must be signed in to change notification settings - Fork 739
Update variable names in wavernn model #797
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
Update variable names in wavernn model #797
Conversation
Codecov Report
@@ Coverage Diff @@
## master #797 +/- ##
==========================================
+ Coverage 89.82% 89.84% +0.01%
==========================================
Files 34 34
Lines 2654 2648 -6
==========================================
- Hits 2384 2379 -5
+ Misses 270 269 -1
Continue to review full report at Codecov.
|
test/test_models.py
Outdated
|
|
||
| def test_mol(self): | ||
| """Validate the output dimensions of a _WaveRNN model in mol mode. | ||
| """Validate the output dimensions of a _WaveRNN model in mol loss. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "with mol loss"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test has been removed.
torchaudio/models/_wavernn.py
Outdated
| if self.mode == 'waveform': | ||
| self.n_classes = 2 ** n_bits | ||
| elif self.mode == 'mol': | ||
| if self.loss == 'crossentropy': | ||
| self.n_classes = n_classes | ||
| elif self.loss == 'mol': | ||
| self.n_classes = 30 | ||
| else: | ||
| raise ValueError(f"Expected mode: `waveform` or `mol`, but found {self.mode}") | ||
| raise ValueError(f"Expected loss: `crossentropy` or `mol`, but found {self.loss}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed offline that we would remove the "loss/mode" parameter for WaveRNN. Let's do it as part of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have removed it. I also removed the sample_rate parameter since it is not needed.
torchaudio/models/_wavernn.py
Outdated
| n_hidden: the number of hidden dimensions (default=128) | ||
| n_output: the number of output dimensions (default=128) | ||
| n_hidden_resblock: the number of hidden dimensions of resblock (default=128) | ||
| n_output_melresnet: the number of output dimensions of melresnet (default=128) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are clear as they are for a MelResBlock. Let's keep n_hidden and n_output here, but add "of resblock" and "of melresnet" in the description as you have done here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I kept them as before and changed the description.
vincentqb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Update audio preprocessing tutorial
This is to update the variable names in WaveRNN model.
Related to #735