From d5bfe00426e247c9f1af19f6d2bc8a47c7a5ccbc Mon Sep 17 00:00:00 2001 From: Michael Kofler Date: Wed, 20 May 2026 09:00:10 +0200 Subject: [PATCH] fixed reg loss not being normalized by batch_split --- DeepSDFStruct/deep_sdf/training.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DeepSDFStruct/deep_sdf/training.py b/DeepSDFStruct/deep_sdf/training.py index f1450372..a4720ada 100644 --- a/DeepSDFStruct/deep_sdf/training.py +++ b/DeepSDFStruct/deep_sdf/training.py @@ -600,9 +600,9 @@ def empirical_stat(latent_vecs, indices): chunk_loss = loss_fun(pred_sdf, sdf_gt[i].to(device)) l2_size_loss = torch.sum(torch.norm(batch_lat_vecs, dim=1)) - reg_loss = ( - code_reg_lambda * min(1, epoch / 100) * l2_size_loss - ) / num_sdf_samples + reg_loss = (code_reg_lambda * min(1, epoch / 100) * l2_size_loss) / ( + num_sdf_samples / batch_split + ) chunk_loss = chunk_loss + reg_loss.to(device) batch_reg_loss = batch_reg_loss + reg_loss.to(device)