Skip to content

Commit

Permalink
Add early stopping patience to reduce variance
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkarvonen committed Oct 25, 2024
1 parent d5a215a commit 5285563
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions evals/shift_and_tpp/eval_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class EvalConfig:
)

spurious_corr: bool = True

# This reduces randomness in the SCR results
early_stopping_patience: int = 40

# Load datset and probes
train_set_size: int = 4000
test_set_size: int = 1000 # This is limited as the test set is smaller than the train set
Expand Down
1 change: 1 addition & 0 deletions evals/shift_and_tpp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ def run_eval_single_dataset(
epochs=config.probe_epochs,
lr=config.probe_lr,
spurious_corr=config.spurious_corr,
early_stopping_patience=config.early_stopping_patience,
)

torch.set_grad_enabled(False)
Expand Down

0 comments on commit 5285563

Please sign in to comment.