AlonSaguy commited on
Commit
fe7b3cb
·
verified ·
1 Parent(s): 32b2d91

Publish 0.0.1_encoder

Browse files
README.md CHANGED
@@ -9,13 +9,13 @@ tags:
9
  - international-brain-lab
10
  ---
11
 
12
- # Ephys Atlas spatial encoder (2026_W42)
13
 
14
  Predicts the **electrophysiological feature vector expected at a channel's position** -- from
15
  the anatomical context at that position and the recorded features of nearby channels on other
16
  insertions (the position selects both; the network itself is not given coordinates). Trained by the
17
- [International Brain Laboratory](https://www.internationalbrainlab.com/) on the Ephys Atlas
18
- feature release `2026_W42`.
19
 
20
  > **The input is a position, not features.** This is the inverse of the region classifier: that
21
  > model takes features and returns a region; this one takes a channel's `x, y, z` (Allen frame,
@@ -61,7 +61,7 @@ Also published, for users who preprocess new recordings or evaluate the model:
61
  import pandas as pd
62
  from ephysatlas import load_pretrained
63
 
64
- model = load_pretrained("int-brain-lab/ea-encoder-channel", revision="2026_W45")
65
  df = pd.read_parquet("example/features_sample.parquet") # channel positions (x, y, z)
66
  out = model.predict(df) # one pred_<feature> column each
67
  print(out.head())
@@ -101,9 +101,9 @@ input return identical predictions.
101
 
102
  ## Reproducibility
103
 
104
- **Pin the revision.** `revision="2026_W45"` is an immutable tag. Omitting `revision` resolves to
105
- `main`, which tracks whichever model is currently recommended and *will* change when a new feature
106
- vintage is published -- fine for a first look, not for anything you publish or re-run.
107
 
108
  `ephysatlas_model.json` records the training-time `environment` and `random_seed`. Verify your
109
  install reproduces the shipped output:
@@ -114,5 +114,5 @@ model.selftest()
114
 
115
  ## Citation
116
 
117
- Please cite the International Brain Laboratory Ephys Atlas. Model id `2026_W45_encoder`,
118
- feature vintage `2026_W42`.
 
9
  - international-brain-lab
10
  ---
11
 
12
+ # ELECTRA channel-level model 0.0.1
13
 
14
  Predicts the **electrophysiological feature vector expected at a channel's position** -- from
15
  the anatomical context at that position and the recorded features of nearby channels on other
16
  insertions (the position selects both; the network itself is not given coordinates). Trained by the
17
+ [International Brain Laboratory](https://www.internationalbrainlab.com/) on the feature release
18
+ `2026_W42` of ELECTRA, the IBL Electrophysiological Reference Atlas.
19
 
20
  > **The input is a position, not features.** This is the inverse of the region classifier: that
21
  > model takes features and returns a region; this one takes a channel's `x, y, z` (Allen frame,
 
61
  import pandas as pd
62
  from ephysatlas import load_pretrained
63
 
64
+ model = load_pretrained("int-brain-lab/ea-encoder-channel", revision="0.0.1")
65
  df = pd.read_parquet("example/features_sample.parquet") # channel positions (x, y, z)
66
  out = model.predict(df) # one pred_<feature> column each
67
  print(out.head())
 
101
 
102
  ## Reproducibility
103
 
104
+ **Pin the revision.** `revision="0.0.1"` is an immutable tag. Omitting `revision` resolves to
105
+ `main`, which tracks whichever model is currently recommended and *will* change when a new model
106
+ is published -- fine for a first look, not for anything you publish or re-run.
107
 
108
  `ephysatlas_model.json` records the training-time `environment` and `random_seed`. Verify your
109
  install reproduces the shipped output:
 
114
 
115
  ## Citation
116
 
117
+ Please cite ELECTRA, the IBL Electrophysiological Reference Atlas. Model `int-brain-lab/ea-encoder-channel`, version
118
+ `0.0.1`, feature release `2026_W42`.
checksums.json CHANGED
@@ -8,23 +8,23 @@
8
  },
9
  {
10
  "path": "confidence_model.pt",
11
- "hash": "403aad8f4bbf6a6fc74f3e265fc0c6ef6170cb16",
12
  "bytes": 387569
13
  },
14
  {
15
  "path": "ephysatlas_model.json",
16
- "hash": "71094f93de398621b88710786e7dcce829e7d810",
17
- "bytes": 7159
18
  },
19
  {
20
  "path": "example/expected_predictions.parquet",
21
- "hash": "bcf18b6767a0e6515817545ea5535b9c42d82302",
22
- "bytes": 155654
23
  },
24
  {
25
  "path": "example/features_sample.parquet",
26
- "hash": "9ffe5f3d21ad23034bc9911343387e2e0801cbfb",
27
- "bytes": 32773
28
  },
29
  {
30
  "path": "merfish_vol_pca.npy",
@@ -33,27 +33,27 @@
33
  },
34
  {
35
  "path": "neighbor_bank.npz",
36
- "hash": "8e85d962aa4025e10d74e6d84827f515ce10e25e",
37
- "bytes": 41257247
38
  },
39
  {
40
  "path": "preprocessing/channel_stats.npz",
41
- "hash": "55589db3ddb461ca38ebd84f37f277e2ce710c3e",
42
- "bytes": 3375
43
  },
44
  {
45
  "path": "results/confidence_validation.json",
46
- "hash": "dfe88777963eb3e3758ae338c0dc50cad61a2bf9",
47
- "bytes": 291
48
  },
49
  {
50
  "path": "results/test_r2.json",
51
- "hash": "1d7512056b840fe3382d2d0e00e4501fcb2b7e88",
52
- "bytes": 1976
53
  },
54
  {
55
  "path": "spatial_encoder.pt",
56
- "hash": "7fe1e6760cdf2158f6b3db9476d0a80b50f83cd1",
57
  "bytes": 4485389
58
  },
59
  {
 
8
  },
9
  {
10
  "path": "confidence_model.pt",
11
+ "hash": "c6aefee104754b4f23aea39bb4eb65e70684c18b",
12
  "bytes": 387569
13
  },
14
  {
15
  "path": "ephysatlas_model.json",
16
+ "hash": "c8000a03d5c3799f383b777a857f16392cc02c20",
17
+ "bytes": 7177
18
  },
19
  {
20
  "path": "example/expected_predictions.parquet",
21
+ "hash": "139c47f376b94e2a40934d37f5c6db74906f5cb7",
22
+ "bytes": 155673
23
  },
24
  {
25
  "path": "example/features_sample.parquet",
26
+ "hash": "ed37712f2406dcadbae59c0a962acbca6c18be7a",
27
+ "bytes": 32792
28
  },
29
  {
30
  "path": "merfish_vol_pca.npy",
 
33
  },
34
  {
35
  "path": "neighbor_bank.npz",
36
+ "hash": "bd574b1b0e97516df7e26e2705b55b26dcfccb02",
37
+ "bytes": 41258953
38
  },
39
  {
40
  "path": "preprocessing/channel_stats.npz",
41
+ "hash": "c9d2eb15080e79799b8b06ef668fb74a7a20b022",
42
+ "bytes": 3382
43
  },
44
  {
45
  "path": "results/confidence_validation.json",
46
+ "hash": "f0704026b5b897ab185e820b4357c92dcc23dde4",
47
+ "bytes": 290
48
  },
49
  {
50
  "path": "results/test_r2.json",
51
+ "hash": "3d54a113ef33003e54bab413b2e146a1058e237d",
52
+ "bytes": 1971
53
  },
54
  {
55
  "path": "spatial_encoder.pt",
56
+ "hash": "d7aee68febf0dd7a3c0841c7e5c2ea327779595f",
57
  "bytes": 4485389
58
  },
59
  {
confidence_model.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7baa2fb3da2a1a0777d3a27772b1d468f5f778d31754f7c94984c81b41950348
3
  size 387569
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03558643e945cb2ef176c4f2c67c83a562a916c0dcf9c42a95b712f471cc9e5e
3
  size 387569
ephysatlas_model.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "model_id": "2026_W45_encoder",
3
  "task": "spatial-encoding",
4
  "model_class": "NeighborInpaintingModel",
5
  "vintage": "2026_W42",
@@ -9,17 +9,17 @@
9
  "validation_size": 97,
10
  "testing_size": 196,
11
  "best_epoch": 3,
12
- "mean_test_r2": 0.38690146803855896
13
  },
14
  "environment": {
15
  "python": "3.11.9",
16
  "xgboost": "3.2.0",
17
  "scikit_learn": "1.8.0",
18
  "numpy": "2.3.5",
19
- "pandas": "3.0.5",
20
  "torch": "2.7.1+cu118",
21
  "ephysatlas": "0.9.0",
22
- "iblatlas": "1.2.0"
23
  },
24
  "method": "transformer",
25
  "granularity": "channel",
@@ -138,7 +138,7 @@
138
  "clipping": "per feature, thresholds from the training channels",
139
  "standardisation": "clipped training channels (features); all non-recorded atlas voxels (context)",
140
  "stats_file": "preprocessing/channel_stats.npz",
141
- "hemisphere": "x mirrored to the left hemisphere (x = -|x|)"
142
  },
143
  "prediction": {
144
  "trilinear_context": true,
@@ -172,7 +172,6 @@
172
  "max_len": null,
173
  "seed": 0,
174
  "max_abs_shift_channels": 64,
175
- "extra_trace_channels_each_side": 128,
176
  "channel_step_um": 20.0,
177
  "suspicious_probe_prob": 0.15,
178
  "suspicious_perturb_min_um": 150.0,
 
1
  {
2
+ "model_id": "0.0.1_encoder",
3
  "task": "spatial-encoding",
4
  "model_class": "NeighborInpaintingModel",
5
  "vintage": "2026_W42",
 
9
  "validation_size": 97,
10
  "testing_size": 196,
11
  "best_epoch": 3,
12
+ "mean_test_r2": 0.3864326477050781
13
  },
14
  "environment": {
15
  "python": "3.11.9",
16
  "xgboost": "3.2.0",
17
  "scikit_learn": "1.8.0",
18
  "numpy": "2.3.5",
19
+ "pandas": "2.3.3",
20
  "torch": "2.7.1+cu118",
21
  "ephysatlas": "0.9.0",
22
+ "iblatlas": "1.3.1"
23
  },
24
  "method": "transformer",
25
  "granularity": "channel",
 
138
  "clipping": "per feature, thresholds from the training channels",
139
  "standardisation": "clipped training channels (features); all non-recorded atlas voxels (context)",
140
  "stats_file": "preprocessing/channel_stats.npz",
141
+ "hemisphere": "x mirrored to the left hemisphere about the atlas midline (ephysatlas.hemispheres.MIDLINE_X, 44 um left of bregma)"
142
  },
143
  "prediction": {
144
  "trilinear_context": true,
 
172
  "max_len": null,
173
  "seed": 0,
174
  "max_abs_shift_channels": 64,
 
175
  "channel_step_um": 20.0,
176
  "suspicious_probe_prob": 0.15,
177
  "suspicious_perturb_min_um": 150.0,
example/expected_predictions.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2eb01f158082fe2431b46db02252f90ca6c7b201ad2b9c66a1f64fdffb8c3f28
3
- size 155654
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72640735f534d4f8cc6ae2743196a60f4dbe54418c0b5bfe45c8a0aa0d2b7449
3
+ size 155673
example/features_sample.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b8f21feb7f424e1e35901c94d9697fa32cbad08313439e22959cd5db31bce74c
3
- size 32773
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca61d69a3d7a6566d0e489dcc72dfdb2e674ce4e76a252c2aff580170f7ba7af
3
+ size 32792
neighbor_bank.npz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:19e8d67d1caed2b1924e6d874cd6593dbc4db83cebdb60b6ae56219a47ae45f2
3
- size 41257247
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0ea3590183940df6dc4390cdc9acc48618505d8b09b247edda6b96875a7ba5b4
3
+ size 41258953
preprocessing/channel_stats.npz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:382e1b809e68211c307e497ecb8badce3f2d541dd35d8978cb6372d9f4273915
3
- size 3375
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36eb0b1e24c81e0a7e1215d36221051a1aaf3245a6bd0ce86a50648766e0de28
3
+ size 3382
results/confidence_validation.json CHANGED
@@ -1,14 +1,14 @@
1
  {
2
  "split": "validation (synthetic misalignments)",
3
- "accuracy": 0.7430398947594502,
4
  "confusion_matrix": [
5
  [
6
- 165491,
7
- 65595
8
  ],
9
  [
10
- 10975,
11
- 55923
12
  ]
13
  ],
14
  "classes": [
 
1
  {
2
  "split": "validation (synthetic misalignments)",
3
+ "accuracy": 0.746325306056701,
4
  "confusion_matrix": [
5
  [
6
+ 161301,
7
+ 62823
8
  ],
9
  [
10
+ 12768,
11
+ 61092
12
  ]
13
  ],
14
  "classes": [
results/test_r2.json CHANGED
@@ -1,50 +1,50 @@
1
  {
2
  "split": "test",
3
  "n_test_insertions": 196,
4
- "mean_r2": 0.38690146803855896,
5
  "per_feature": {
6
- "rms_lf": 0.6616796851158142,
7
- "psd_delta": 0.6039469242095947,
8
- "psd_theta": 0.6966370344161987,
9
- "psd_alpha": 0.6868009567260742,
10
- "psd_beta": 0.6934996843338013,
11
- "psd_gamma": 0.6706020832061768,
12
- "psd_lfp": 0.6726920008659363,
13
- "rms_lf_bpr": 0.40590810775756836,
14
- "psd_delta_bpr": 0.37969040870666504,
15
- "psd_theta_bpr": 0.5058459043502808,
16
- "psd_alpha_bpr": 0.496732234954834,
17
- "psd_beta_bpr": 0.44282883405685425,
18
- "psd_gamma_bpr": 0.37929797172546387,
19
- "psd_lfp_bpr": 0.4151318073272705,
20
- "psd_residual_delta": 0.3717383146286011,
21
- "psd_residual_theta": 0.34016698598861694,
22
- "psd_residual_alpha": 0.3065006732940674,
23
- "psd_residual_beta": 0.30070960521698,
24
- "psd_residual_gamma": 0.21757078170776367,
25
- "psd_residual_lfp": 0.19501382112503052,
26
- "aperiodic_offset": 0.6575870513916016,
27
- "aperiodic_exponent": 0.3343881368637085,
28
- "decay_fit_error": 0.24594855308532715,
29
- "decay_fit_r_squared": 0.29205119609832764,
30
- "decay_n_peaks": 0.11254686117172241,
31
- "cor_ratio": 0.530724823474884,
32
- "rms_ap": 0.5341757535934448,
33
- "alpha_mean": 0.3785160779953003,
34
- "alpha_std": 0.3072406053543091,
35
- "spike_count": 0.31083184480667114,
36
- "depolarisation_slope": 0.3715524673461914,
37
- "polarity": 0.25774699449539185,
38
- "recovery_slope": 0.3061023950576782,
39
- "repolarisation_slope": 0.3072677254676819,
40
- "slowness_s_per_m": 0.08528697490692139,
41
- "slowness_s_per_m_std": 0.40063661336898804,
42
- "spatial_spread_um": 0.28104740381240845,
43
- "spatial_spread_um_std": 0.11777418851852417,
44
- "tip_val": 0.23696184158325195,
45
- "spike_width_secs": 0.4941251873970032,
46
- "predepolarisation_width_secs": 0.3440001606941223,
47
- "spike_amplitude": 0.26268327236175537,
48
- "peak_to_trough_ratio_log": 0.024572134017944336
49
  }
50
  }
 
1
  {
2
  "split": "test",
3
  "n_test_insertions": 196,
4
+ "mean_r2": 0.3864326477050781,
5
  "per_feature": {
6
+ "rms_lf": 0.6608211398124695,
7
+ "psd_delta": 0.6028587818145752,
8
+ "psd_theta": 0.6918218731880188,
9
+ "psd_alpha": 0.6843409538269043,
10
+ "psd_beta": 0.6907578706741333,
11
+ "psd_gamma": 0.6702374219894409,
12
+ "psd_lfp": 0.6713683009147644,
13
+ "rms_lf_bpr": 0.4029957056045532,
14
+ "psd_delta_bpr": 0.3776191473007202,
15
+ "psd_theta_bpr": 0.5010265111923218,
16
+ "psd_alpha_bpr": 0.4952860474586487,
17
+ "psd_beta_bpr": 0.4416058659553528,
18
+ "psd_gamma_bpr": 0.3798099160194397,
19
+ "psd_lfp_bpr": 0.4127731919288635,
20
+ "psd_residual_delta": 0.37373650074005127,
21
+ "psd_residual_theta": 0.33198755979537964,
22
+ "psd_residual_alpha": 0.30064451694488525,
23
+ "psd_residual_beta": 0.2966166138648987,
24
+ "psd_residual_gamma": 0.22155386209487915,
25
+ "psd_residual_lfp": 0.19938170909881592,
26
+ "aperiodic_offset": 0.6557266712188721,
27
+ "aperiodic_exponent": 0.33777135610580444,
28
+ "decay_fit_error": 0.2508656978607178,
29
+ "decay_fit_r_squared": 0.2946712374687195,
30
+ "decay_n_peaks": 0.11502385139465332,
31
+ "cor_ratio": 0.5255212783813477,
32
+ "rms_ap": 0.5364702343940735,
33
+ "alpha_mean": 0.37363916635513306,
34
+ "alpha_std": 0.3089878559112549,
35
+ "spike_count": 0.30980920791625977,
36
+ "depolarisation_slope": 0.375978946685791,
37
+ "polarity": 0.25484418869018555,
38
+ "recovery_slope": 0.3090283274650574,
39
+ "repolarisation_slope": 0.3113645315170288,
40
+ "slowness_s_per_m": 0.086406409740448,
41
+ "slowness_s_per_m_std": 0.395765483379364,
42
+ "spatial_spread_um": 0.2819598317146301,
43
+ "spatial_spread_um_std": 0.12447232007980347,
44
+ "tip_val": 0.23651427030563354,
45
+ "spike_width_secs": 0.4956895112991333,
46
+ "predepolarisation_width_secs": 0.3421085476875305,
47
+ "spike_amplitude": 0.26507002115249634,
48
+ "peak_to_trough_ratio_log": 0.021671831607818604
49
  }
50
  }
spatial_encoder.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:946ab414dab4b21e161c54b6eaa1f1ce121468c3643d65bb2085809b846c7ff1
3
  size 4485389
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc475b549d984ada89b2749d57784c72066edd9fb2407d5a064c5862e572b58c
3
  size 4485389