matthewshu commited on
Commit
70a7dfa
·
verified ·
1 Parent(s): 64d4c91

initial: random-prior control retrain (RPE1 mean pearson_delta=0.376)

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ predictions/scgpt_replogle_test.h5ad filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - scgpt
4
+ - perturbation-prediction
5
+ - replogle
6
+ - control-experiment
7
+ ---
8
+
9
+ # scgpt-replogle-random-ft
10
+
11
+ scGPT finetuned on Replogle K562 perturbations with a **random per-gene
12
+ frozen prior table** (per-row Gaussian matched to ESM2 mean/std/L2-norm,
13
+ seed 42). Architecturally identical to `matthewshu/scgpt-replogle-esm-ft`
14
+ but the gene prior carries no protein-specific information.
15
+
16
+ This is the control experiment for: "does ESM-specific protein knowledge
17
+ drive scGPT's K562→RPE1 OOD gain, or does any frozen gene-indexed vector
18
+ field do it?"
19
+
20
+ ## RPE1 (held-out cell line) results
21
+
22
+ | condition | mean pearson_delta |
23
+ |---|---|
24
+ | ESM (treatment, [scgpt-replogle-esm-ft](https://huggingface.co/matthewshu/scgpt-replogle-esm-ft)) | 0.508 |
25
+ | **Random-prior retrain (this model)** | **0.376** |
26
+ | base scGPT, no prior ([scgpt-replogle-base-ft](https://huggingface.co/matthewshu/scgpt-replogle-base-ft)) | 0.183 |
27
+ | ESM with shuffled gene→protein at inference time | 0.085 |
28
+
29
+ Random-prior is **+0.193 above base** and **−0.132 below ESM**: ~59% of
30
+ the ESM-vs-base OOD gap is captured by the architectural pathway alone
31
+ (any consistent frozen gene-indexed vector field), and ~41% comes from
32
+ ESM-specific protein information.
33
+
34
+ ## Training
35
+
36
+ - batch_size 192, max_seq_len 1200, lr 1e-4, num_epochs up to 30,
37
+ early_stop=10 on val pearson_delta, seed 42
38
+ - Stopped at epoch 15 (best val pearson_delta 0.179 at epoch 5)
39
+
40
+ Random table generated by `tools/make_random_gene_prior.py --mode per_row`:
41
+ preserves per-gene magnitude (matches each row's mean and std from ESM2)
42
+ while randomizing per-dim content.
43
+
44
+ Note: `args.json` and `vocab.json` are scGPT's pretraining metadata
45
+ (included for parity with sibling repos); they do NOT reflect the
46
+ finetune hyperparameters above. See `training_stats.json` for actual
47
+ finetune behavior.
48
+
49
+ Source commit: github.com/mattshu0410/sc-interp @ feat/model-diffing
args.json ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "data_source": "/scratch/ssd004/datasets/cellxgene/scb_strict/human",
3
+ "save_dir": "/scratch/ssd004/datasets/cellxgene/save/cellxgene_census_human-May23-08-36-2023",
4
+ "load_model": null,
5
+ "n_hvg": null,
6
+ "valid_size_or_ratio": 0.003,
7
+ "dist_backend": "nccl",
8
+ "grad_accu_steps": 1,
9
+ "pad_token": "<pad>",
10
+ "input_style": "binned",
11
+ "input_emb_style": "continuous",
12
+ "n_bins": 51,
13
+ "max_seq_len": 1200,
14
+ "training_tasks": "both",
15
+ "dist_url": "tcp://gpu188.cluster.local:53833",
16
+ "mask_ratio": [
17
+ 0.25,
18
+ 0.5,
19
+ 0.75
20
+ ],
21
+ "trunc_by_sample": true,
22
+ "vocab_path": "/scratch/ssd004/datasets/cellxgene/scFormer/scformer/tokenizer/default_census_vocab.json",
23
+ "rank": 0,
24
+ "batch_size": 32,
25
+ "eval_batch_size": 64,
26
+ "epochs": 6,
27
+ "lr": 0.0001,
28
+ "scheduler_interval": 100,
29
+ "scheduler_factor": 0.99,
30
+ "warmup_ratio_or_step": 10000.0,
31
+ "no_cls": true,
32
+ "no_cce": true,
33
+ "fp16": true,
34
+ "fast_transformer": true,
35
+ "nlayers": 12,
36
+ "nheads": 8,
37
+ "embsize": 512,
38
+ "d_hid": 512,
39
+ "dropout": 0.2,
40
+ "n_layers_cls": 3,
41
+ "log_interval": 9000,
42
+ "save_interval": 27000,
43
+ "mask_value": -1,
44
+ "pad_value": -2,
45
+ "USE_CLS": false,
46
+ "USE_CCE": false,
47
+ "MVC": true,
48
+ "USE_GENERATIVE_TRAINING": true,
49
+ "world_size": 16,
50
+ "distributed": true,
51
+ "local_rank": 0,
52
+ "gpu": 0
53
+ }
best_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:795c9b96faf0cf87703ae1ff1ec05555244b60dab6cdac9ff5301f655448663d
3
+ size 1461069572
eval/agg_results.csv ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ statistic,overlap_at_N,overlap_at_50,overlap_at_100,overlap_at_200,overlap_at_500,precision_at_N,precision_at_50,precision_at_100,precision_at_200,precision_at_500,de_spearman_sig,de_direction_match,de_spearman_lfc_sig,de_sig_genes_recall,de_nsig_counts_real,de_nsig_counts_pred,pr_auc,roc_auc,pearson_delta,mse,mae,mse_delta,mae_delta,discrimination_score_l1,discrimination_score_l2,discrimination_score_cosine,pearson_edistance,clustering_agreement
2
+ count,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0,1047.0
3
+ null_count,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
4
+ mean,0.5315693122658063,0.09858643744030564,0.19910219675262655,0.2428175740210124,0.2586914995224451,0.5307824812601826,0.09858643744030564,0.19910219675262655,0.2428175740210124,0.2586914995224451,0.8553737314248665,0.7281596220922115,0.48471034859495704,0.5498632931151887,3966.452722063037,4049.0171919770773,0.5233715492360114,0.3714726964781706,0.3759255707335108,0.07279648384525873,0.17131042716724026,0.07279648365668148,0.17131042725263376,0.507316579228961,0.5111142127094378,0.5631581203949247,0.4515368796586464,0.12239719232113007
5
+ std,0.1283043968634738,0.030325006993415827,0.06259796196527483,0.07415642964687104,0.044110448833754194,0.1236768422074464,0.030325006993415827,0.06259796196527483,0.07415642964687104,0.044110448833754194,4.656432363590828e-17,0.09191346678095684,0.09069834201684067,0.14114003912877918,582.5376356511573,676.5696540904598,0.10092463120084808,0.020872011158312786,0.1040956179306545,0.011026412645742662,0.015628684254863006,0.011026412668906724,0.01562868439531315,0.2871761812846565,0.2876423734130491,0.29654421458102087,1.164108090897707e-17,2.9102702272442677e-18
6
+ min,0.26004382761139516,0.0,0.0,0.06,0.13,0.2535070140280561,0.0,0.0,0.06,0.13,0.8553737314248664,0.358356290174472,0.20383284331804927,0.27720964207450693,2525.0,2980.0,0.3122390226819703,0.31983286332017297,0.0880637839436531,0.0525658093392849,0.14178027212619781,0.052565816789865494,0.14178027212619781,0.0009551098376313627,0.0009551098376313627,0.0009551098376313627,0.45153687965864653,0.12239719232113007
7
+ 25%,0.4271280626420813,0.08,0.16,0.19,0.232,0.4395539906103286,0.08,0.16,0.19,0.232,0.8553737314248664,0.6910171268787137,0.42404653477818754,0.4308717379233759,3550.0,3471.0,0.4474924497347775,0.3587513735058554,0.30258312821388245,0.06462626904249191,0.15970981121063232,0.06462626904249191,0.15970981121063232,0.2597898758357211,0.2645654250238777,0.3190066857688634,0.45153687965864653,0.12239719232113007
8
+ 50%,0.5306446490949508,0.1,0.22,0.25,0.262,0.5346134411318848,0.1,0.22,0.25,0.262,0.8553737314248664,0.7393396020118085,0.4812071555187687,0.5435791645177926,3969.0,3966.0,0.5203707878417683,0.3698206417273757,0.35708415508270264,0.07018604874610901,0.16828416287899017,0.07018604874610901,0.16828416287899017,0.504297994269341,0.5100286532951289,0.5663801337153773,0.45153687965864653,0.12239719232113007
9
+ 75%,0.6255969436485196,0.12,0.24,0.295,0.286,0.6194570135746607,0.12,0.24,0.295,0.286,0.8553737314248664,0.7905342080599812,0.543225421232448,0.6527655838454784,4351.0,4516.0,0.5882330211485134,0.38120455700015876,0.43711578845977783,0.07855168730020523,0.17975343763828278,0.07855168730020523,0.17975343763828278,0.7574021012416428,0.7593123209169055,0.8481375358166189,0.45153687965864653,0.12239719232113007
10
+ max,0.9248764415156507,0.26,0.41,0.49,0.48,0.9253511924207776,0.26,0.41,0.49,0.48,0.8553737314248664,0.8892911010558069,0.7681549080948894,0.9358561004581707,6070.0,6146.0,0.9194332544342587,0.47423760224347816,0.6703550219535828,0.11626482754945755,0.23644642531871796,0.11626482754945755,0.23644644021987915,1.0,1.0,1.0,0.45153687965864653,0.12239719232113007
eval/results.csv ADDED
The diff for this file is too large to render. See raw diff
 
predictions/scgpt_replogle_test.h5ad ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f01a3fb7a48bf6a67cab7592649f37a3dd356f42edd3a9ac95108b7b59b9e211
3
+ size 6286754900
scgpt_random_prior.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3e5f524daeff44209788669ca407942bfc07d4fee942f1f66ea6cf018060484
3
+ size 1243074656
training_stats.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "wall_clock_s": 18846.542730093002,
3
+ "wandb_run_url": "https://wandb.ai/sc-interp/sc-interp/runs/twl9b2hk",
4
+ "reason": "max_epochs",
5
+ "details": {
6
+ "num_epochs_trained": 30,
7
+ "cells_seen": 5400630,
8
+ "steps": 28140,
9
+ "best_val_metrics": {
10
+ "pearson": 0.9940869808197021,
11
+ "pearson_de": 0.9796794652938843,
12
+ "pearson_delta": 0.18789944052696228,
13
+ "pearson_de_delta": 0.4907083511352539
14
+ },
15
+ "best_val_epoch": 22,
16
+ "stop_metric": "pearson_delta"
17
+ }
18
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff