Skip to content

Commit

Permalink
use abs on early exit condition
Browse files Browse the repository at this point in the history
  • Loading branch information
shuklabhay committed Sep 25, 2024
1 parent aeb63f3 commit ce694f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ def training_loop(train_loader, val_loader):
)

# Early exit/saving
if val_w_dist < best_val_w_dist:
best_val_w_dist = val_w_dist
if np.abs(val_w_dist) < best_val_w_dist:
best_val_w_dist = np.abs(val_w_dist)
epochs_no_improve = 0
save_model(generator)
else:
Expand Down

0 comments on commit ce694f5

Please sign in to comment.