Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use concept-erasure implementation of LEACE and SAL #252

Merged
merged 8 commits into from
Jul 10, 2023
Merged
Prev Previous commit
Fix test failure
  • Loading branch information
norabelrose committed Jul 6, 2023
commit 3db2cc8419aa4d6d4ecab0826e2e8d8cbb631fdc
1 change: 0 additions & 1 deletion elk/evaluation/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def apply_to_layer(

reporter_path = experiment_dir / "reporters" / f"layer_{layer}.pt"
reporter = torch.load(reporter_path, map_location=device)
reporter.eval()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the eval() here still neded?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because CcsReporter doesn't actually have any submodules like nn.BatchNorm or nn.Dropout whose behavior changes due to eval()


row_bufs = defaultdict(list)
for ds_name, (val_h, val_gt, _) in val_output.items():
Expand Down
2 changes: 1 addition & 1 deletion elk/training/eigen_reporter.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice :) no need for pseudolabels at inference time

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __post_init__(self):


class EigenFitter:
"""A linear reporter whose weights are computed via eigendecomposition.
"""Fit a linear reporter with eigendecomposition.

Args:
cfg: The reporter configuration.
Expand Down