Moving WaveRNN padding into the model
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 799
- Avg merge
- 58m
- Merged PRs (30d)
- 3
Description
Currently WaveRNN's forward method expects client code to to pad the input spectrogram to the specific size (kernel_size - 1 // 2). This breaks the encapsulation. The WaveRNN's forward method should perform padding itself. The newly added infer method does this.
General direction
- In
forward, add padding before upsample.
https://github.com/pytorch/audio/blob/483d8fae63f0102a31e9842a593f462399116fbd/torchaudio/models/wavernn.py#L319-L322
as done ininfer
https://github.com/pytorch/audio/blob/483d8fae63f0102a31e9842a593f462399116fbd/torchaudio/models/wavernn.py#L381 - Update the collate function in the training script so that it does not perform padding
https://github.com/pytorch/audio/blob/a6f9cf8babfb096381e914e23950371478672b3e/examples/pipeline_wavernn/datasets.py#L76 - Update tests and surrounding comments about the shape.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in torchaudio/models/wavernn.py at the forward and infer methods, then inspect examples/pipeline_wavernn/datasets.py and the existing shape-related tests and comments. Move the padding responsibility into forward, remove it from the training collate function, and update tests and comments so the expected shapes and behavior are consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- audio-video-rtc, machine-learning
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100