We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 089de3b commit 8a0782fCopy full SHA for 8a0782f
src/weathergen/train/loss_calculator.py
@@ -326,8 +326,8 @@ def compute_loss(
326
loss_fstep = loss_fstep + (loss_fct_weight * loss_lfct * strm_loss_weight)
327
ctr_fsteps += 1 if loss_lfct > 0.0 else 0
328
329
- loss = loss + loss_fstep / ctr_fsteps if ctr_fsteps > 0 else loss
330
- ctr_streams += 1 if loss_fstep > 0 else 0
+ loss = loss + (loss_fstep / (ctr_fsteps if ctr_fsteps > 0 else 1.0))
+ ctr_streams += 1 if ctr_fsteps > 0 else 0
331
332
# normalize by forecast step
333
losses_all[strm.name] /= ctr_fsteps if ctr_fsteps > 0 else 1.0
0 commit comments