rpranav commited on
Commit
a38f20f
·
verified ·
1 Parent(s): fe7b3cb

Publish 0.0.1

Browse files
Files changed (5) hide show
  1. LICENSE +6 -6
  2. README.md +118 -118
  3. checksums.json +65 -65
  4. ephysatlas_model.json +275 -274
  5. example/expected_predictions.parquet +2 -2
LICENSE CHANGED
@@ -1,6 +1,6 @@
1
- Creative Commons Attribution 4.0 International (CC-BY-4.0)
2
-
3
- You are free to share and adapt this material for any purpose, including commercially,
4
- provided you give appropriate credit.
5
-
6
- Full licence text: https://creativecommons.org/licenses/by/4.0/legalcode
 
1
+ Creative Commons Attribution 4.0 International (CC-BY-4.0)
2
+
3
+ You are free to share and adapt this material for any purpose, including commercially,
4
+ provided you give appropriate credit.
5
+
6
+ Full licence text: https://creativecommons.org/licenses/by/4.0/legalcode
README.md CHANGED
@@ -1,118 +1,118 @@
1
- ---
2
- license: cc-by-4.0
3
- library_name: pytorch
4
- tags:
5
- - neuroscience
6
- - electrophysiology
7
- - neuropixels
8
- - spatial-encoding
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,
22
- > metres) and returns the 43 ephys features it would expect there. Feeding it the
23
- > feature columns instead of coordinates is the most common mistake -- `predict` raises and names
24
- > the coordinates it needs.
25
-
26
- ## What ships in this repo, and why all of it is needed
27
-
28
- A published encoder is not the weights alone. `predict` cannot run without every one of:
29
-
30
- - `spatial_encoder.pt` -- the trained network.
31
- - the context PCA volumes (`agea_vol_pca.npy`, `merfish_vol_pca.npy`) -- the anatomical context
32
- it samples at each position: principal components of the molecular atlas (AGEA gene
33
- expression) and of the cellular atlas (MERFISH subclass cell-type densities, denoised with
34
- `iblatlas.genomics.merfish.denoise_volume`
35
- -- NaNs filled, Gaussian-smoothed, renormalised within the brain; see `config.context.sources`
36
- in `ephysatlas_model.json`).
37
- - `neighbor_bank.npz` -- the **neighbour bank**: the position, standardised feature vector and
38
- insertion id of every training channel. At inference the model gathers the nearest recorded
39
- channels from this bank and attends to them, so the bank *is* part of the model, the way the
40
- stored points are part of a k-nearest-neighbours model. It cannot be reconstructed from the
41
- weights, which is why it is shipped here rather than recomputed on your machine.
42
-
43
- Also published, for users who preprocess new recordings or evaluate the model:
44
-
45
- - `preprocessing/channel_stats.npz` -- the training-data statistics: per-feature clipping
46
- thresholds (0.5th/99.5th percentiles of the training channels) and the feature and context
47
- standardisation.
48
- - `split.json` -- the probe split (train / validation / test insertions).
49
- - `results/` -- held-out evaluation summaries (per-feature test R²; confidence-model validation).
50
- - `confidence_model.pt` -- a per-channel alignment-confidence model scoring how consistent a
51
- probe's recorded features are with this encoder's predictions at its reported positions; load it
52
- with `model.load_confidence_model()`.
53
-
54
- > **First run downloads the Allen volume.** Building the context sampler constructs an
55
- > `AllenAtlas`, which fetches the Allen CCF volume from `download.alleninstitute.org` (public, no
56
- > account, a few hundred MB) the first time it runs on a machine, then caches it.
57
-
58
- ## Quickstart
59
-
60
- ```python
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())
68
- ```
69
-
70
- `load_pretrained` is the entry point for every ephysatlas model, whatever its family -- it reads
71
- `ephysatlas_model.json` and returns the right wrapper. Use it rather than importing a concrete
72
- class, so your code keeps working as the package evolves.
73
-
74
- `predict` returns one row per input channel, indexed identically to the input, with a
75
- `pred_<feature>` column per entry in `outputs.columns`. The `pred_` prefix keeps `df.join(out)`
76
- from colliding with the ground-truth feature columns of the same names.
77
-
78
- ## Inputs
79
-
80
- - Indexed by `(pid, channel)`, one row per recording channel.
81
- - The coordinate columns `x, y, z` named in `ephysatlas_model.json` under `inputs.columns`, in
82
- the Allen atlas frame, **in metres**. The feature columns are *not* read -- they are the output.
83
-
84
- ## Neighbourhood selection
85
-
86
- For each query position the model attends to recorded channels within **500.0 µm**, taking
87
- the **nearest 8** (`selection: nearest`). This is deterministic: two calls on the same
88
- input return identical predictions.
89
-
90
- > Training used a *random* subset of the in-radius neighbours; this published `predict` takes the
91
- > nearest instead. The two agree exactly whenever a position has at most 8 neighbours in
92
- > radius, and differ only in dense regions where the training-time subset would itself have varied
93
- > run to run. Deterministic output is the right contract for a published model.
94
-
95
- ## Limitations
96
-
97
- - Trained on IBL Neuropixels 1.0 recordings in mouse. Transfer to NP2, other species or other
98
- rigs is untested.
99
- - Coverage follows IBL brain-wide-map targeting; predictions far from any recorded channel fall
100
- back on anatomical context alone and are correspondingly weaker.
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:
110
-
111
- ```python
112
- model.selftest()
113
- ```
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`.
 
1
+ ---
2
+ license: cc-by-4.0
3
+ library_name: pytorch
4
+ tags:
5
+ - neuroscience
6
+ - electrophysiology
7
+ - neuropixels
8
+ - spatial-encoding
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,
22
+ > metres) and returns the 43 ephys features it would expect there. Feeding it the
23
+ > feature columns instead of coordinates is the most common mistake -- `predict` raises and names
24
+ > the coordinates it needs.
25
+
26
+ ## What ships in this repo, and why all of it is needed
27
+
28
+ A published encoder is not the weights alone. `predict` cannot run without every one of:
29
+
30
+ - `spatial_encoder.pt` -- the trained network.
31
+ - the context PCA volumes (`agea_vol_pca.npy`, `merfish_vol_pca.npy`) -- the anatomical context
32
+ it samples at each position: principal components of the molecular atlas (AGEA gene
33
+ expression) and of the cellular atlas (MERFISH subclass cell-type densities, denoised with
34
+ `iblatlas.genomics.merfish.denoise_volume`
35
+ -- NaNs filled, Gaussian-smoothed, renormalised within the brain; see `config.context.sources`
36
+ in `ephysatlas_model.json`).
37
+ - `neighbor_bank.npz` -- the **neighbour bank**: the position, standardised feature vector and
38
+ insertion id of every training channel. At inference the model gathers the nearest recorded
39
+ channels from this bank and attends to them, so the bank *is* part of the model, the way the
40
+ stored points are part of a k-nearest-neighbours model. It cannot be reconstructed from the
41
+ weights, which is why it is shipped here rather than recomputed on your machine.
42
+
43
+ Also published, for users who preprocess new recordings or evaluate the model:
44
+
45
+ - `preprocessing/channel_stats.npz` -- the training-data statistics: per-feature clipping
46
+ thresholds (0.5th/99.5th percentiles of the training channels) and the feature and context
47
+ standardisation.
48
+ - `split.json` -- the probe split (train / validation / test insertions).
49
+ - `results/` -- held-out evaluation summaries (per-feature test R²; confidence-model validation).
50
+ - `confidence_model.pt` -- a per-channel alignment-confidence model scoring how consistent a
51
+ probe's recorded features are with this encoder's predictions at its reported positions; load it
52
+ with `model.load_confidence_model()`.
53
+
54
+ > **First run downloads the Allen volume.** Building the context sampler constructs an
55
+ > `AllenAtlas`, which fetches the Allen CCF volume from `download.alleninstitute.org` (public, no
56
+ > account, a few hundred MB) the first time it runs on a machine, then caches it.
57
+
58
+ ## Quickstart
59
+
60
+ ```python
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())
68
+ ```
69
+
70
+ `load_pretrained` is the entry point for every ephysatlas model, whatever its family -- it reads
71
+ `ephysatlas_model.json` and returns the right wrapper. Use it rather than importing a concrete
72
+ class, so your code keeps working as the package evolves.
73
+
74
+ `predict` returns one row per input channel, indexed identically to the input, with a
75
+ `pred_<feature>` column per entry in `outputs.columns`. The `pred_` prefix keeps `df.join(out)`
76
+ from colliding with the ground-truth feature columns of the same names.
77
+
78
+ ## Inputs
79
+
80
+ - Indexed by `(pid, channel)`, one row per recording channel.
81
+ - The coordinate columns `x, y, z` named in `ephysatlas_model.json` under `inputs.columns`, in
82
+ the Allen atlas frame, **in metres**. The feature columns are *not* read -- they are the output.
83
+
84
+ ## Neighbourhood selection
85
+
86
+ For each query position the model attends to recorded channels within **500.0 µm**, taking
87
+ the **nearest 8** (`selection: nearest`). This is deterministic: two calls on the same
88
+ input return identical predictions.
89
+
90
+ > Training used a *random* subset of the in-radius neighbours; this published `predict` takes the
91
+ > nearest instead. The two agree exactly whenever a position has at most 8 neighbours in
92
+ > radius, and differ only in dense regions where the training-time subset would itself have varied
93
+ > run to run. Deterministic output is the right contract for a published model.
94
+
95
+ ## Limitations
96
+
97
+ - Trained on IBL Neuropixels 1.0 recordings in mouse. Transfer to NP2, other species or other
98
+ rigs is untested.
99
+ - Coverage follows IBL brain-wide-map targeting; predictions far from any recorded channel fall
100
+ back on anatomical context alone and are correspondingly weaker.
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:
110
+
111
+ ```python
112
+ model.selftest()
113
+ ```
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
@@ -1,65 +1,65 @@
1
- {
2
- "algo": "sha1",
3
- "files": [
4
- {
5
- "path": "agea_vol_pca.npy",
6
- "hash": "b710b6b26797e78bbc49762e80f2ae5ab6bb3896",
7
- "bytes": 31865328
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",
31
- "hash": "c8fd5484d8c0619c5c542242c9ac99876db56892",
32
- "bytes": 31865328
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
- {
60
- "path": "split.json",
61
- "hash": "9a2632fb0ac52e5c1021622ee6de3e3c71be9169",
62
- "bytes": 47626
63
- }
64
- ]
65
- }
 
1
+ {
2
+ "algo": "sha1",
3
+ "files": [
4
+ {
5
+ "path": "agea_vol_pca.npy",
6
+ "hash": "b710b6b26797e78bbc49762e80f2ae5ab6bb3896",
7
+ "bytes": 31865328
8
+ },
9
+ {
10
+ "path": "confidence_model.pt",
11
+ "hash": "c6aefee104754b4f23aea39bb4eb65e70684c18b",
12
+ "bytes": 387569
13
+ },
14
+ {
15
+ "path": "ephysatlas_model.json",
16
+ "hash": "beae2e7c660f50c686bd4a8595a00392d04a9025",
17
+ "bytes": 6936
18
+ },
19
+ {
20
+ "path": "example/expected_predictions.parquet",
21
+ "hash": "1b17cdaecffbd0c0f0074c186b9ad224e3805e72",
22
+ "bytes": 155677
23
+ },
24
+ {
25
+ "path": "example/features_sample.parquet",
26
+ "hash": "ed37712f2406dcadbae59c0a962acbca6c18be7a",
27
+ "bytes": 32792
28
+ },
29
+ {
30
+ "path": "merfish_vol_pca.npy",
31
+ "hash": "c8fd5484d8c0619c5c542242c9ac99876db56892",
32
+ "bytes": 31865328
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
+ {
60
+ "path": "split.json",
61
+ "hash": "9a2632fb0ac52e5c1021622ee6de3e3c71be9169",
62
+ "bytes": 47626
63
+ }
64
+ ]
65
+ }
ephysatlas_model.json CHANGED
@@ -1,274 +1,275 @@
1
- {
2
- "model_id": "0.0.1_encoder",
3
- "task": "spatial-encoding",
4
- "model_class": "NeighborInpaintingModel",
5
- "vintage": "2026_W42",
6
- "training": {
7
- "random_seed": 0,
8
- "training_size": 663,
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",
26
- "artifacts": {
27
- "weights": "spatial_encoder.pt",
28
- "context": [
29
- "agea_vol_pca.npy",
30
- "merfish_vol_pca.npy"
31
- ],
32
- "confidence": "confidence_model.pt",
33
- "neighbor_bank": "neighbor_bank.npz",
34
- "stats": "preprocessing/channel_stats.npz",
35
- "split": "split.json",
36
- "results": [
37
- "results/confidence_validation.json",
38
- "results/test_r2.json"
39
- ]
40
- },
41
- "inputs": {
42
- "table": "channels.pqt",
43
- "index": [
44
- "pid",
45
- "channel"
46
- ],
47
- "columns": [
48
- "x",
49
- "y",
50
- "z"
51
- ]
52
- },
53
- "outputs": {
54
- "kind": "continuous",
55
- "columns": [
56
- "rms_lf",
57
- "psd_delta",
58
- "psd_theta",
59
- "psd_alpha",
60
- "psd_beta",
61
- "psd_gamma",
62
- "psd_lfp",
63
- "rms_lf_bpr",
64
- "psd_delta_bpr",
65
- "psd_theta_bpr",
66
- "psd_alpha_bpr",
67
- "psd_beta_bpr",
68
- "psd_gamma_bpr",
69
- "psd_lfp_bpr",
70
- "psd_residual_delta",
71
- "psd_residual_theta",
72
- "psd_residual_alpha",
73
- "psd_residual_beta",
74
- "psd_residual_gamma",
75
- "psd_residual_lfp",
76
- "aperiodic_offset",
77
- "aperiodic_exponent",
78
- "decay_fit_error",
79
- "decay_fit_r_squared",
80
- "decay_n_peaks",
81
- "cor_ratio",
82
- "rms_ap",
83
- "alpha_mean",
84
- "alpha_std",
85
- "spike_count",
86
- "depolarisation_slope",
87
- "polarity",
88
- "recovery_slope",
89
- "repolarisation_slope",
90
- "slowness_s_per_m",
91
- "slowness_s_per_m_std",
92
- "spatial_spread_um",
93
- "spatial_spread_um_std",
94
- "tip_val",
95
- "spike_width_secs",
96
- "predepolarisation_width_secs",
97
- "spike_amplitude",
98
- "peak_to_trough_ratio_log"
99
- ],
100
- "feature_order_sha256": "06be1cc9256bcb6bd85b0b45e9e1769f35ef417bf6ee9f0dc8d5603f947163c6"
101
- },
102
- "config": {
103
- "architecture": {
104
- "f_ctx": 100,
105
- "f_ephys": 43,
106
- "f_out": 43,
107
- "d_model": 128,
108
- "nhead": 8,
109
- "depth": 2,
110
- "drop": 0.15,
111
- "use_positions": false
112
- },
113
- "neighbourhood": {
114
- "radius_um": 500.0,
115
- "m_max": 8,
116
- "selection": "nearest",
117
- "allow_same_probe": false
118
- },
119
- "context": {
120
- "n_cell_pcs": 50,
121
- "n_gene_pcs": 50,
122
- "voxel_um": 200,
123
- "sources": {
124
- "merfish": {
125
- "level": "subclass",
126
- "volume": "iblatlas.genomics.merfish.load_volume(label=\"processed\", include_non_neuronal=True)"
127
- },
128
- "agea": {
129
- "volume": "iblatlas.genomics.agea.load(label=\"processed\")"
130
- }
131
- }
132
- },
133
- "preprocessing": {
134
- "clip_percentiles": [
135
- 0.5,
136
- 99.5
137
- ],
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,
145
- "neighbour_draws": 4
146
- },
147
- "confidence": {
148
- "architecture": {
149
- "f_ctx": 100,
150
- "f_e": 43,
151
- "d_model": 64,
152
- "nhead": 4,
153
- "depth": 2,
154
- "mlp_ratio": 2.0,
155
- "drop": 0.1
156
- },
157
- "training": {
158
- "d_model": 64,
159
- "nhead": 4,
160
- "depth": 2,
161
- "mlp_ratio": 2.0,
162
- "drop": 0.1,
163
- "epochs": 50,
164
- "lr": 0.0003,
165
- "weight_decay": 0.001,
166
- "grad_clip": 1.0,
167
- "batch_size": 16,
168
- "samples_per_probe": 8,
169
- "cache_samples": true,
170
- "patience": 4,
171
- "min_delta": 0.0001,
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,
178
- "suspicious_perturb_max_um": 500.0,
179
- "suspicious_chunk_frac_min": 0.1,
180
- "suspicious_chunk_frac_max": 1.0,
181
- "suspicious_n_chunks_min": 1,
182
- "suspicious_n_chunks_max": 3,
183
- "perturb_n_anchors_min": 3,
184
- "perturb_n_anchors_max": 6,
185
- "perturb_smooth_kernel_min": 9,
186
- "perturb_smooth_kernel_max": 31,
187
- "perturb_taper_frac": 0.2
188
- }
189
- },
190
- "data": {
191
- "project": "ea_active",
192
- "agg": "agg_full",
193
- "table": "raw_ephys_features_denoised.pqt"
194
- },
195
- "hyperparameters": {
196
- "project": "ea_active",
197
- "agg": "agg_full",
198
- "n_cell_pcs": 50,
199
- "n_gene_pcs": 50,
200
- "radius_um": 500,
201
- "m_max": 8,
202
- "batch_size_train": 1024,
203
- "batch_size_eval": 1024,
204
- "d_model": 128,
205
- "nhead": 8,
206
- "depth": 2,
207
- "drop": 0.15,
208
- "use_positions": false,
209
- "epochs": 50,
210
- "lr": 0.0001,
211
- "weight_decay": 0.01,
212
- "lambda_ctr": 0.1,
213
- "pos_radius_um": 500,
214
- "patience": 5,
215
- "conf_epochs": 50,
216
- "conf_batch_size": 16,
217
- "conf_samples_per_probe": 8,
218
- "trilinear_context": true,
219
- "neighbour_draws": 4,
220
- "seed": 0,
221
- "feature_groups": {
222
- "lf": [
223
- "rms_lf",
224
- "psd_delta",
225
- "psd_theta",
226
- "psd_alpha",
227
- "psd_beta",
228
- "psd_gamma",
229
- "psd_lfp",
230
- "rms_lf_bpr",
231
- "psd_delta_bpr",
232
- "psd_theta_bpr",
233
- "psd_alpha_bpr",
234
- "psd_beta_bpr",
235
- "psd_gamma_bpr",
236
- "psd_lfp_bpr",
237
- "psd_residual_delta",
238
- "psd_residual_theta",
239
- "psd_residual_alpha",
240
- "psd_residual_beta",
241
- "psd_residual_gamma",
242
- "psd_residual_lfp",
243
- "aperiodic_offset",
244
- "aperiodic_exponent",
245
- "decay_fit_error",
246
- "decay_fit_r_squared",
247
- "decay_n_peaks",
248
- "cor_ratio"
249
- ],
250
- "ap": [
251
- "rms_ap",
252
- "alpha_mean",
253
- "alpha_std",
254
- "spike_count"
255
- ],
256
- "waveform": [
257
- "depolarisation_slope",
258
- "polarity",
259
- "recovery_slope",
260
- "repolarisation_slope",
261
- "slowness_s_per_m",
262
- "slowness_s_per_m_std",
263
- "spatial_spread_um",
264
- "spatial_spread_um_std",
265
- "tip_val",
266
- "spike_width_secs",
267
- "predepolarisation_width_secs",
268
- "spike_amplitude",
269
- "peak_to_trough_ratio_log"
270
- ]
271
- }
272
- }
273
- }
274
- }
 
 
1
+ {
2
+ "model_id": "0.0.1_encoder",
3
+ "task": "spatial-encoding",
4
+ "model_class": "NeighborInpaintingModel",
5
+ "training": {
6
+ "random_seed": 0,
7
+ "training_size": 663,
8
+ "validation_size": 97,
9
+ "testing_size": 196,
10
+ "best_epoch": 3,
11
+ "mean_test_r2": 0.3864326477050781
12
+ },
13
+ "environment": {
14
+ "python": "3.11.9",
15
+ "xgboost": "3.2.0",
16
+ "scikit_learn": "1.8.0",
17
+ "numpy": "2.3.5",
18
+ "pandas": "2.3.3",
19
+ "torch": "2.7.1+cu118",
20
+ "ephysatlas": "0.9.0",
21
+ "iblatlas": "1.3.1"
22
+ },
23
+ "method": "transformer",
24
+ "granularity": "channel",
25
+ "artifacts": {
26
+ "weights": "spatial_encoder.pt",
27
+ "context": [
28
+ "agea_vol_pca.npy",
29
+ "merfish_vol_pca.npy"
30
+ ],
31
+ "confidence": "confidence_model.pt",
32
+ "neighbor_bank": "neighbor_bank.npz",
33
+ "stats": "preprocessing/channel_stats.npz",
34
+ "split": "split.json",
35
+ "results": [
36
+ "results/confidence_validation.json",
37
+ "results/test_r2.json"
38
+ ]
39
+ },
40
+ "inputs": {
41
+ "table": "channels.pqt",
42
+ "index": [
43
+ "pid",
44
+ "channel"
45
+ ],
46
+ "columns": [
47
+ "x",
48
+ "y",
49
+ "z"
50
+ ]
51
+ },
52
+ "outputs": {
53
+ "kind": "continuous",
54
+ "columns": [
55
+ "rms_lf",
56
+ "psd_delta",
57
+ "psd_theta",
58
+ "psd_alpha",
59
+ "psd_beta",
60
+ "psd_gamma",
61
+ "psd_lfp",
62
+ "rms_lf_bpr",
63
+ "psd_delta_bpr",
64
+ "psd_theta_bpr",
65
+ "psd_alpha_bpr",
66
+ "psd_beta_bpr",
67
+ "psd_gamma_bpr",
68
+ "psd_lfp_bpr",
69
+ "psd_residual_delta",
70
+ "psd_residual_theta",
71
+ "psd_residual_alpha",
72
+ "psd_residual_beta",
73
+ "psd_residual_gamma",
74
+ "psd_residual_lfp",
75
+ "aperiodic_offset",
76
+ "aperiodic_exponent",
77
+ "decay_fit_error",
78
+ "decay_fit_r_squared",
79
+ "decay_n_peaks",
80
+ "cor_ratio",
81
+ "rms_ap",
82
+ "alpha_mean",
83
+ "alpha_std",
84
+ "spike_count",
85
+ "depolarisation_slope",
86
+ "polarity",
87
+ "recovery_slope",
88
+ "repolarisation_slope",
89
+ "slowness_s_per_m",
90
+ "slowness_s_per_m_std",
91
+ "spatial_spread_um",
92
+ "spatial_spread_um_std",
93
+ "tip_val",
94
+ "spike_width_secs",
95
+ "predepolarisation_width_secs",
96
+ "spike_amplitude",
97
+ "peak_to_trough_ratio_log"
98
+ ],
99
+ "feature_order_sha256": "06be1cc9256bcb6bd85b0b45e9e1769f35ef417bf6ee9f0dc8d5603f947163c6"
100
+ },
101
+ "config": {
102
+ "architecture": {
103
+ "f_ctx": 100,
104
+ "f_ephys": 43,
105
+ "f_out": 43,
106
+ "d_model": 128,
107
+ "nhead": 8,
108
+ "depth": 2,
109
+ "drop": 0.15,
110
+ "use_positions": false
111
+ },
112
+ "neighbourhood": {
113
+ "radius_um": 500.0,
114
+ "m_max": 8,
115
+ "selection": "nearest",
116
+ "allow_same_probe": false
117
+ },
118
+ "context": {
119
+ "n_cell_pcs": 50,
120
+ "n_gene_pcs": 50,
121
+ "voxel_um": 200,
122
+ "sources": {
123
+ "merfish": {
124
+ "level": "subclass",
125
+ "volume": "iblatlas.genomics.merfish.load_volume(label=\"processed\", include_non_neuronal=True)"
126
+ },
127
+ "agea": {
128
+ "volume": "iblatlas.genomics.agea.load(label=\"processed\")"
129
+ }
130
+ }
131
+ },
132
+ "preprocessing": {
133
+ "clip_percentiles": [
134
+ 0.5,
135
+ 99.5
136
+ ],
137
+ "clipping": "per feature, thresholds from the training channels",
138
+ "standardisation": "clipped training channels (features); all non-recorded atlas voxels (context)",
139
+ "stats_file": "preprocessing/channel_stats.npz",
140
+ "hemisphere": "x mirrored to the left hemisphere about the atlas midline (ephysatlas.hemispheres.MIDLINE_X, 44 um left of bregma)"
141
+ },
142
+ "prediction": {
143
+ "trilinear_context": true,
144
+ "neighbour_draws": 4
145
+ },
146
+ "confidence": {
147
+ "architecture": {
148
+ "f_ctx": 100,
149
+ "f_e": 43,
150
+ "d_model": 64,
151
+ "nhead": 4,
152
+ "depth": 2,
153
+ "mlp_ratio": 2.0,
154
+ "drop": 0.1
155
+ },
156
+ "training": {
157
+ "d_model": 64,
158
+ "nhead": 4,
159
+ "depth": 2,
160
+ "mlp_ratio": 2.0,
161
+ "drop": 0.1,
162
+ "epochs": 50,
163
+ "lr": 0.0003,
164
+ "weight_decay": 0.001,
165
+ "grad_clip": 1.0,
166
+ "batch_size": 16,
167
+ "samples_per_probe": 8,
168
+ "cache_samples": true,
169
+ "patience": 4,
170
+ "min_delta": 0.0001,
171
+ "max_len": null,
172
+ "seed": 0,
173
+ "max_abs_shift_channels": 64,
174
+ "channel_step_um": 20.0,
175
+ "suspicious_probe_prob": 0.15,
176
+ "suspicious_perturb_min_um": 150.0,
177
+ "suspicious_perturb_max_um": 500.0,
178
+ "suspicious_chunk_frac_min": 0.1,
179
+ "suspicious_chunk_frac_max": 1.0,
180
+ "suspicious_n_chunks_min": 1,
181
+ "suspicious_n_chunks_max": 3,
182
+ "perturb_n_anchors_min": 3,
183
+ "perturb_n_anchors_max": 6,
184
+ "perturb_smooth_kernel_min": 9,
185
+ "perturb_smooth_kernel_max": 31,
186
+ "perturb_taper_frac": 0.2
187
+ }
188
+ },
189
+ "data": {
190
+ "project": "ea_active",
191
+ "agg": "agg_full",
192
+ "table": "raw_ephys_features_denoised.pqt"
193
+ },
194
+ "hyperparameters": {
195
+ "project": "ea_active",
196
+ "agg": "agg_full",
197
+ "n_cell_pcs": 50,
198
+ "n_gene_pcs": 50,
199
+ "radius_um": 500,
200
+ "m_max": 8,
201
+ "batch_size_train": 1024,
202
+ "batch_size_eval": 1024,
203
+ "d_model": 128,
204
+ "nhead": 8,
205
+ "depth": 2,
206
+ "drop": 0.15,
207
+ "use_positions": false,
208
+ "epochs": 50,
209
+ "lr": 0.0001,
210
+ "weight_decay": 0.01,
211
+ "lambda_ctr": 0.1,
212
+ "pos_radius_um": 500,
213
+ "patience": 5,
214
+ "conf_epochs": 50,
215
+ "conf_batch_size": 16,
216
+ "conf_samples_per_probe": 8,
217
+ "trilinear_context": true,
218
+ "neighbour_draws": 4,
219
+ "seed": 0,
220
+ "feature_groups": {
221
+ "lf": [
222
+ "rms_lf",
223
+ "psd_delta",
224
+ "psd_theta",
225
+ "psd_alpha",
226
+ "psd_beta",
227
+ "psd_gamma",
228
+ "psd_lfp",
229
+ "rms_lf_bpr",
230
+ "psd_delta_bpr",
231
+ "psd_theta_bpr",
232
+ "psd_alpha_bpr",
233
+ "psd_beta_bpr",
234
+ "psd_gamma_bpr",
235
+ "psd_lfp_bpr",
236
+ "psd_residual_delta",
237
+ "psd_residual_theta",
238
+ "psd_residual_alpha",
239
+ "psd_residual_beta",
240
+ "psd_residual_gamma",
241
+ "psd_residual_lfp",
242
+ "aperiodic_offset",
243
+ "aperiodic_exponent",
244
+ "decay_fit_error",
245
+ "decay_fit_r_squared",
246
+ "decay_n_peaks",
247
+ "cor_ratio"
248
+ ],
249
+ "ap": [
250
+ "rms_ap",
251
+ "alpha_mean",
252
+ "alpha_std",
253
+ "spike_count"
254
+ ],
255
+ "waveform": [
256
+ "depolarisation_slope",
257
+ "polarity",
258
+ "recovery_slope",
259
+ "repolarisation_slope",
260
+ "slowness_s_per_m",
261
+ "slowness_s_per_m_std",
262
+ "spatial_spread_um",
263
+ "spatial_spread_um_std",
264
+ "tip_val",
265
+ "spike_width_secs",
266
+ "predepolarisation_width_secs",
267
+ "spike_amplitude",
268
+ "peak_to_trough_ratio_log"
269
+ ]
270
+ }
271
+ }
272
+ },
273
+ "data_vintage": "2026_W42",
274
+ "model_version": "0.0.1"
275
+ }
example/expected_predictions.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:72640735f534d4f8cc6ae2743196a60f4dbe54418c0b5bfe45c8a0aa0d2b7449
3
- size 155673
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a0075d4f5035527e880eb3e1be4528701cde07931259570224812f00d62a1ad
3
+ size 155677