Skip to content

fix(discriminators): CQT forward omits channel squeeze (+2 more) - #16

Draft
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/discriminators-assorted-8287f5f0
Draft

fix(discriminators): CQT forward omits channel squeeze (+2 more)#16
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/discriminators-assorted-8287f5f0

Conversation

@andrewwhitecdw

@andrewwhitecdw andrewwhitecdw commented Jul 27, 2026

Copy link
Copy Markdown

This PR addresses 3 issues in discriminators.py.

Fix 1

fix: CQT forward omits channel squeeze before nnAudio CQT transform

Fix: Replace:

        x = self.resample(x)

        z = self.cqt_transform(x)

with:

        x = x.squeeze(1)
        x = self.resample(x)

        z = self.cqt_transform(x)

Fix 2

fix: CQT discriminator output not flattened and final fmap omitted

Fix: Replace:

        latent_z = self.conv_post(latent_z)

        return latent_z, fmap

with:

        latent_z = self.conv_post(latent_z)
        fmap.append(latent_z)
        latent_z = torch.flatten(latent_z, 1, -1)

        return latent_z, fmap

Fix 3

fix: DiscriminatorP period typed as List[int] but used as scalar

Fix: Replace:

        h: AttrDict,
        period: List[int],
        kernel_size: int = 5,

with:

        h: AttrDict,
        period: int,
        kernel_size: int = 5,

Files changed

  • discriminators.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant