Fix channel dimension mismatch in DiscriminatorSTFT#98
Open
Mr-Neutr0n wants to merge 1 commit intofacebookresearch:mainfrom
Open
Fix channel dimension mismatch in DiscriminatorSTFT#98Mr-Neutr0n wants to merge 1 commit intofacebookresearch:mainfrom
Mr-Neutr0n wants to merge 1 commit intofacebookresearch:mainfrom
Conversation
The input channels for the second convolution layer should match the output channels of the first convolution (self.filters), not the scaled value. The first convolution outputs self.filters channels, so the second convolution should expect that many input channels, not filters_scale * self.filters which caused dimension mismatch when filters_scale > 1. Fixes facebookresearch#93
Author
|
hi there, following up on this — the channel dimension mismatch in DiscriminatorSTFT can silently produce wrong results. would be great to get a review when you get a chance |
Author
|
Friendly bump! Let me know if there's anything I should update or improve to help move this forward. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DiscriminatorSTFTProblem
When
filters_scale > 1, there is a dimension mismatch between convolution layers:self.filterschannelsmin(filters_scale * self.filters, max_filters)input channelsFor example, with
filters=64andfilters_scale=2:This causes a runtime dimension error.
Solution
Changed line 70 from:
To:
Now the second convolution correctly expects
self.filtersinput channels, matching the first convolution's output.Test plan
DiscriminatorSTFT(filters=64, filters_scale=2)without dimension errorFixes #93