Repository navigation
Implemented experiments for ICLR 2027 - #60
Open
jakesmbeattie wants to merge 2 commits into
Open
jakesmbeattie wants to merge 2 commits into
jakesmbeattie wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical and moderate findings currently block reliable execution of several experiments and exports.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 7
Open (15)
Update stale shard hash to a valid regenerated path · New Fix missing mimics.baselines import · New Add missing W1 metrics or remove dependent viewer cells · New Convert Polars columns to NumPy before reshaping · New Remove trailing shell continuation backslash · New Remove trailing shell continuation backslash · New Remove trailing shell continuation backslash · New Correct mislabeled layer 22 and 24 options · New Point launcher to the new DINOv3 sweep · New Point launcher to the new training sweep · New Validate or preprocess signed inputs for NMF · New Implement ridge regularization or remove the parameter · New Prevent dense NMF codes from being serialized as CSR · New Include NMF run IDs in the NMSE sweep · New Correct stale BioCLIP experiment description · New
What changed in this PR
Adds ICLR 2027 experiment infrastructure for NMF baselines, butterfly SAE training, and mimic classification analysis.
Changes:
- Implements and tests
MiniBatchNMF. - Adds shard-generation, training, inference, scoring, and evaluation sweeps.
- Adds classifier baseline exports, recorded results, and an interactive DINO viewer.
| File | Description |
|---|---|
contrib/trait_discovery/tests/test_nmf.py |
NMF tests and checkpoint coverage |
contrib/trait_discovery/sweeps/baselines_train.py |
NMF sweep integration |
contrib/trait_discovery/sweeps/011_iclr/train_butterfly_saes.sh |
Butterfly SAE launcher |
contrib/trait_discovery/sweeps/011_iclr/train_butterfly_saes.py |
Butterfly SAE configurations |
contrib/trait_discovery/sweeps/011_iclr/nmf_baseline_2.sh |
NMF launcher |
contrib/trait_discovery/sweeps/011_iclr/nmf_baseline_1.sh |
NMF launcher |
contrib/trait_discovery/sweeps/011_iclr/nmf_baseline_0.sh |
NMF launcher |
contrib/trait_discovery/sweeps/011_iclr/imagenet_val_shards.sh |
Validation shard generation |
contrib/trait_discovery/sweeps/011_iclr/imagenet_train_shards.sh |
Training shard generation |
contrib/trait_discovery/sweeps/011_iclr/butterflies_shards.sh |
Butterfly shard generation |
contrib/trait_discovery/sweeps/011_iclr/baselines_train_2.py |
Large NMF sweep |
contrib/trait_discovery/sweeps/011_iclr/baselines_train_1.py |
Medium NMF sweep |
contrib/trait_discovery/sweeps/011_iclr/baselines_train_0.py |
Small NMF sweep |
contrib/trait_discovery/sweeps/011_iclr/baselines_nmse.py |
Baseline NMSE evaluation |
contrib/trait_discovery/src/tdiscovery/baselines.py |
NMF implementation and integration |
contrib/trait_discovery/notebooks/baselines.py |
NMF result handling |
contrib/trait_discovery/notebooks/__marimo__/session/figures.py.json |
Marimo session metadata |
contrib/mimics/exps/005-iclr-discovery/train_dino_saes.sh |
DINO SAE launcher |
contrib/mimics/exps/005-iclr-discovery/train_16k_dino.py |
DINO SAE configurations |
contrib/mimics/exps/005-iclr-discovery/score_dino.py |
DINO scoring configurations |
contrib/mimics/exps/005-iclr-discovery/inference_dino.sh |
DINO inference launcher |
contrib/mimics/exps/005-iclr-discovery/inference_dino.py |
DINO inference configurations |
contrib/mimics/exps/005-iclr-discovery/generate_dino_shards.sh |
DINO shard generation |
contrib/mimics/exps/005-iclr-discovery/dino_viewer.py |
Interactive feature viewer |
contrib/mimics/exps/003-baselines/export_csv.py |
Baseline CSV exporter |
contrib/mimics/exps/003-baselines/baselines.csv |
Recorded classifier results |
contrib/mimics/exps/003-baselines/baseline_dinov3.py |
DINOv3 baseline configuration |
contrib/mimics/exps/003-baselines/baseline_bioclip.py |
BioCLIP baseline configuration |
.gitignore |
Model cache ignore rule |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| def make_cfgs() -> list[dict]: | ||
| return [ | ||
| { | ||
| "shards_dpath": "/fs/scratch/PAS2136/jbeattie/saev/shards/a1da4c41", |
|
|
||
| import beartype | ||
| import polars as pl | ||
| from mimics.baselines import DEFAULT_OUT_DPATH |
Comment on lines
+174
to
+187
| feature_table = mo.ui.table( | ||
| filtered_df | ||
| .select( | ||
| "run_id", | ||
| "feature_id", | ||
| "selectivity", | ||
| "auroc", | ||
| "support_diff", | ||
| "support_erato", | ||
| "support_melpomene", | ||
| "mean_act_erato", | ||
| "mean_act_melpomene", | ||
| "w1_act", | ||
| "w1_firing" |
|
|
||
|
|
||
| _regr = linear_model.LinearRegression() | ||
| _regr.fit(random_sample_df["w1_act"].reshape((-1, 1)), random_sample_df["selectivity"].reshape((-1, 1))) |
| #!/bin/sh | ||
|
|
||
| uv run scripts/launch.py baseline::train \ | ||
| --sweep sweeps/011_iclr/baselines_train_0.py \ No newline at end of file |
| if batch.shape[0] == 0: | ||
| return self | ||
|
|
||
| acts = batch.to(self.device, dtype=torch.float32) |
| D = self.D_ | ||
| for _ in range(self.d_iters): | ||
| numerator = zta_pos + ztz_neg @ D | ||
| denominator = zta_neg + ztz_pos @ D + self.eps |
| assert self._ddt_reg_inv_ is not None | ||
|
|
||
| z = acts @ self.D_.mT @ self._ddt_reg_inv_ | ||
| z = z.clamp_min(self.eps) |
Comment on lines
+9
to
+23
| baseline_run_ids = [ | ||
| "myy5btgw", # kmeans, k=1 | ||
| "qmbo5jxw", # pca, k=1 | ||
| "kwh4twl0", # pca, k=4 | ||
| "za1xuhhn", # pca, k=16 | ||
| "a1x1laxm", # pca, k=64 | ||
| "unu6dbfb", # pca, k=256 | ||
| "dzv7ha4u", # pca, k=1024 | ||
| "lm51bf37", # semi-nmf, k=1 | ||
| "em7hzdw0", # semi-nmf, k=4 | ||
| "cmf1j0gd", # semi-nmf, k=16 | ||
| "q6qtn8f6", # semi-nmf, k=64 | ||
| "rv1wfbws", # semi-nmf, k=256 | ||
| "k9sot7dd", # semi-nmf, k=1024 | ||
| ] |
| @@ -0,0 +1,22 @@ | |||
| """Inference for Pareto-optimal 16K BioCLIP SAEs on Cambridge butterflies (256p, v1.6).""" | |||
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Experiments for ICLR 2027: