Skip to content

Commit e232a30

Browse files
committed
Update worker_training.py
1 parent 649a966 commit e232a30

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

napari_cellseg3d/code_models/worker_training.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,9 @@ def get_loader_func(num_samples):
484484
patience=self.config.scheduler_patience,
485485
verbose=VERBOSE_SCHEDULER,
486486
)
487-
dice_metric = DiceMetric(include_background=True, reduction="mean")
487+
dice_metric = DiceMetric(
488+
include_background=True, reduction="mean", ignore_empty=False
489+
)
488490

489491
best_metric = -1
490492
best_metric_epoch = -1
@@ -650,6 +652,13 @@ def get_loader_func(num_samples):
650652

651653
# logger.debug(len(val_outputs))
652654
# logger.debug(len(val_labels))
655+
dice_test = [
656+
utils.dice_coeff(i, j)
657+
for i, j in zip(val_outputs, val_labels)
658+
]
659+
logger.debug(
660+
f"TEST VALIDATION Dice score : {dice_test}"
661+
)
653662

654663
dice_metric(y_pred=val_outputs, y=val_labels)
655664

0 commit comments

Comments
 (0)