Skip to content

fix(loss): mag_weight term uses log mels instead of linear (+1 more) - #19

Open
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/loss-assorted-fe5fe8b0
Open

fix(loss): mag_weight term uses log mels instead of linear (+1 more)#19
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/loss-assorted-fe5fe8b0

Conversation

@andrewwhitecdw

@andrewwhitecdw andrewwhitecdw commented Jul 27, 2026

Copy link
Copy Markdown

This PR addresses 2 issues in loss.py.

Fix 1

fix: mag_weight term uses log mels instead of linear magnitudes

Fix: Replace:

            loss += self.log_weight * self.loss_fn(x_logmels, y_logmels)
            loss += self.mag_weight * self.loss_fn(x_logmels, y_logmels)

with:

            loss += self.log_weight * self.loss_fn(x_logmels, y_logmels)
            loss += self.mag_weight * self.loss_fn(x_mels, y_mels)

Fix 2

fix: self.weight is stored but never applied to the returned loss

Fix: Replace:

        return loss

with:

        return loss * self.weight

Files changed

  • loss.py

@andrewwhitecdw
andrewwhitecdw marked this pull request as ready for review July 28, 2026 00:32
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