From 45fced55bcbacfd214a9e57f49965148ce389b8e Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Thu, 9 Apr 2026 16:19:52 +0200 Subject: [PATCH] fix: exclude GAFilter params from L2-SP regularization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit L2-SP anchors trainable params to their pretrained values. GAFilter is a newly initialized module (identity FIR filter) with no pretrained values — anchoring it to identity initialization would resist learning. Exclude gafilter params from the L2-SP loss so they train freely. Co-Authored-By: Claude Sonnet 4.6 --- nodes/selva_bigvgan_trainer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nodes/selva_bigvgan_trainer.py b/nodes/selva_bigvgan_trainer.py index 3a28bf9..d14b185 100644 --- a/nodes/selva_bigvgan_trainer.py +++ b/nodes/selva_bigvgan_trainer.py @@ -812,7 +812,9 @@ def _do_train(vocoder, mel_converter, clips, l2sp_loss = torch.zeros(1, device=device) if lambda_l2sp > 0.0 and ref_params: for name, param in vocoder.named_parameters(): - if name in ref_params and param.requires_grad: + # Skip GAFilter — newly initialized, not pretrained; L2-SP + # anchoring to identity would fight against learning. + if name in ref_params and param.requires_grad and "gafilter" not in name: l2sp_loss = l2sp_loss + F.mse_loss( param, ref_params[name], reduction="sum" )