Skip to content

Commit 2f097b6

Browse files
committed
FIX: fixed important validation issues
1 parent 6550643 commit 2f097b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flaxdiff/trainer/general_diffusion_trainer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ def __compare_run_against_best__(self, top_k=2, metric="train/best_loss", from_s
649649
best_runs, bounds = self.__get_best_general_runs__(metric=metric, top_k=top_k)
650650

651651
# Determine if lower or higher values are better (for loss, lower is better)
652-
is_lower_better = "loss" in metric.lower()
652+
is_lower_better = True
653653

654654
# Check if current run is one of the best
655655
if metric == "train/best_loss":
@@ -661,7 +661,7 @@ def __compare_run_against_best__(self, top_k=2, metric="train/best_loss", from_s
661661

662662
# Check based on bounds
663663
if (is_lower_better and current_run_metric < bounds[1]) or (not is_lower_better and current_run_metric > bounds[0]):
664-
print(f"Current run {self.wandb.id} meets performance criteria.")
664+
print(f"Current run {self.wandb.id} meets performance criteria. Current metric: {current_run_metric}, Best bounds: {bounds}")
665665
is_best = (is_lower_better and current_run_metric < bounds[0]) or (not is_lower_better and current_run_metric > bounds[1])
666666
return True, is_best
667667

0 commit comments

Comments
 (0)