Skip to content

Commit

Permalink
rename to elicit
Browse files Browse the repository at this point in the history
  • Loading branch information
derpyplops committed Jul 12, 2023
1 parent 1e45970 commit 4385598
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions elk/training/sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,19 @@ def execute(self):
data = replace(
self.run_template.data, model=model, datasets=train_datasets
)
run = replace(self.run_template, data=data, out_dir=out_dir)
elicit = replace(self.run_template, data=data, out_dir=out_dir)
if var_weight is not None and neg_cov_weight is not None:
assert isinstance(run.net, EigenReporterConfig)
run.net.var_weight = var_weight
run.net.neg_cov_weight = neg_cov_weight
assert isinstance(elicit.net, EigenReporterConfig)
elicit.net.var_weight = var_weight
elicit.net.neg_cov_weight = neg_cov_weight

# Add hyperparameter values to output directory if needed
assert run.out_dir is not None
run.out_dir /= f"var_weight={var_weight:.2f}"
run.out_dir /= f"neg_cov_weight={neg_cov_weight:.2f}"
assert elicit.out_dir is not None
elicit.out_dir /= f"var_weight={var_weight:.2f}"
elicit.out_dir /= f"neg_cov_weight={neg_cov_weight:.2f}"

try:
run.execute()
elicit.execute()
except torch.linalg.LinAlgError as e:
print(colorize(f"LinAlgError: {e}", "red"))
continue
Expand All @@ -160,10 +160,10 @@ def execute(self):
if eval_dataset in train_datasets:
continue

assert run.out_dir is not None
assert elicit.out_dir is not None
# TODO we should fix this so that this isn't needed

eval = run.make_eval(model, eval_dataset)
eval = elicit.make_eval(model, eval_dataset)
eval.execute(highlight_color="green")

if self.visualize:
Expand Down

0 comments on commit 4385598

Please sign in to comment.