rpranav commited on
Commit
3cf60f4
·
verified ·
1 Parent(s): 3ce373a

Publish 0.0.1

Browse files
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,88 +1,88 @@
1
- ---
2
- license: cc-by-4.0
3
- library_name: pytorch
4
- tags:
5
- - neuroscience
6
- - electrophysiology
7
- - neuropixels
8
- - unit-level-encoder
9
- - international-brain-lab
10
- ---
11
-
12
- # ELECTRA unit-level model 0.0.1
13
-
14
- Predicts **which kinds of neurons you expect to record at a brain position**, and their expected
15
- waveform phenotype. Trained by the
16
- [International Brain Laboratory](https://www.internationalbrainlab.com/) on spike-sorted units of
17
- the IBL data release `2026_W41` (70564 training units), for ELECTRA, the IBL
18
- Electrophysiological Reference Atlas.
19
-
20
- The model has four stages:
21
-
22
- 1. a multimodal autoencoder embeds each unit's multi-channel **waveform**, 3D
23
- **autocorrelogram** and **population coupling** (waveform, acg, stpc) into a
24
- 60-d latent -- its phenotype;
25
- 2. a **hierarchical Gaussian mixture** over the standardised latents: 30 putative cell
26
- types, each split into at most 10 sub-types (300 in all). Assignment is
27
- top-down -- the most likely type, then the most likely of its sub-types -- so a unit's
28
- sub-type always lies inside its type. The types and sub-types are global;
29
- 3. the **sub-type weights depend on the molecular and cellular context** (PCA volumes of the
30
- molecular and cellular atlases) at the position: one network predicts the type weights, a
31
- second the shares of the sub-types within each type;
32
- 4. a **members readout** maps the model back to 10 interpretable waveform features:
33
- `depolarisation_slope`, `recovery_slope`, `repolarisation_slope`, `spatial_spread_um`, `tip_val`, `spike_width_secs`, `predepolarisation_width_secs`, `spike_amplitude`, `peak_to_trough_ratio_log`, `polarity`. Each sub-type is represented by its training units, from anywhere in the brain,
34
- weighted by their posterior of the sub-type.
35
-
36
- > **The input is a position.** `predict` takes `x, y, z` (IBL/Allen frame, metres) and returns the
37
- > expected phenotype there: the local sub-type weights times each sub-type's expected features.
38
- > `mixture_weights` returns the local putative cell-type composition itself.
39
-
40
- ## Quickstart
41
-
42
- ```python
43
- import pandas as pd
44
- from ephysatlas import load_pretrained
45
-
46
- model = load_pretrained("int-brain-lab/ea-encoder-unit", revision="0.0.1")
47
- df = pd.read_parquet("example/positions_sample.parquet") # positions (x, y, z)
48
- out = model.predict(df) # one pred_<feature> column each
49
- types = model.mixture_weights(df, level="type") # putative cell-type composition
50
- subtypes = model.mixture_weights(df) # ... and of the sub-types
51
- draws = model.sample(df, n_samples=16) # training units drawn at each position
52
- model.selftest() # reproduces the shipped outputs
53
- ```
54
-
55
- Units you recorded yourself can be embedded with `model.encode(waveform, acg, stpc)` (arrays shaped
56
- as in `config.json`), then assigned to a putative cell type and sub-type with `model.assign(z)`.
57
-
58
- ## What ships here
59
-
60
- - `autoencoder.pt`, `shared_latent_scaler.joblib` -- the phenotype encoder and its latent scaler.
61
- - `types_gmm.joblib`, `subtypes_gmm.joblib`, `subtype_parent.npy` -- the types, the sub-types and
62
- the type of each sub-type.
63
- - `context_transform.joblib`, `context_weights_types.pt`, `context_weights_subtypes.pt` -- context
64
- -> type and sub-type weights.
65
- - `members.npz` -- the phenotype features of the training units and their sub-type posteriors
66
- (the readout; part of the model, like the stored points of any nearest-neighbour model).
67
- - `agea_vol_pca.npy`, `merfish_vol_pca.npy` -- the molecular and cellular context volumes, the same frozen
68
- volumes as the channel-level model `C:/Users/bodic/ephys-atlas/results/releases/ea-encoder-channel/0.0.1_encoder` of release `2026_W41`.
69
- - `split.json`, `config.json`, `preprocessing/unit_stats.npz`, `results/` -- the probe split, the
70
- training configuration, the training-data statistics and held-out evaluation summaries.
71
-
72
- The recorded per-unit dataset (waveforms, ACGs, positions) is **not** here: it stays on IBL S3 and
73
- is only needed to retrain the model or to reproduce the atlas-wide analyses.
74
-
75
- > **First run downloads the Allen volume.** Sampling the context constructs an `AllenAtlas`, which
76
- > fetches the Allen CCF volume (public, no account, a few hundred MB) once per machine.
77
-
78
- ## Reproducibility
79
-
80
- **Pin the revision.** `revision="0.0.1"` is an immutable tag; omitting it resolves to `main`,
81
- which tracks the currently recommended model. `ephysatlas_model.json` records the training-time
82
- environment and random seed; `model.selftest()` verifies your install reproduces the shipped
83
- output (no IBL account needed).
84
-
85
- ## Citation
86
-
87
- Please cite ELECTRA, the IBL Electrophysiological Reference Atlas. Model `int-brain-lab/ea-encoder-unit`, version
88
- `0.0.1`, data release `2026_W41`.
 
1
+ ---
2
+ license: cc-by-4.0
3
+ library_name: pytorch
4
+ tags:
5
+ - neuroscience
6
+ - electrophysiology
7
+ - neuropixels
8
+ - unit-level-encoder
9
+ - international-brain-lab
10
+ ---
11
+
12
+ # ELECTRA unit-level model 0.0.1
13
+
14
+ Predicts **which kinds of neurons you expect to record at a brain position**, and their expected
15
+ waveform phenotype. Trained by the
16
+ [International Brain Laboratory](https://www.internationalbrainlab.com/) on spike-sorted units of
17
+ the IBL data release `2026_W42` (70564 training units), for ELECTRA, the IBL
18
+ Electrophysiological Reference Atlas.
19
+
20
+ The model has four stages:
21
+
22
+ 1. a multimodal autoencoder embeds each unit's multi-channel **waveform**, 3D
23
+ **autocorrelogram** and **population coupling** (waveform, acg, stpc) into a
24
+ 60-d latent -- its phenotype;
25
+ 2. a **hierarchical Gaussian mixture** over the standardised latents: 30 putative cell
26
+ types, each split into at most 10 sub-types (300 in all). Assignment is
27
+ top-down -- the most likely type, then the most likely of its sub-types -- so a unit's
28
+ sub-type always lies inside its type. The types and sub-types are global;
29
+ 3. the **sub-type weights depend on the molecular and cellular context** (PCA volumes of the
30
+ molecular and cellular atlases) at the position: one network predicts the type weights, a
31
+ second the shares of the sub-types within each type;
32
+ 4. a **members readout** maps the model back to 10 interpretable waveform features:
33
+ `depolarisation_slope`, `recovery_slope`, `repolarisation_slope`, `spatial_spread_um`, `tip_val`, `spike_width_secs`, `predepolarisation_width_secs`, `spike_amplitude`, `peak_to_trough_ratio_log`, `polarity`. Each sub-type is represented by its training units, from anywhere in the brain,
34
+ weighted by their posterior of the sub-type.
35
+
36
+ > **The input is a position.** `predict` takes `x, y, z` (IBL/Allen frame, metres) and returns the
37
+ > expected phenotype there: the local sub-type weights times each sub-type's expected features.
38
+ > `mixture_weights` returns the local putative cell-type composition itself.
39
+
40
+ ## Quickstart
41
+
42
+ ```python
43
+ import pandas as pd
44
+ from ephysatlas import load_pretrained
45
+
46
+ model = load_pretrained("int-brain-lab/ea-encoder-unit", revision="0.0.1")
47
+ df = pd.read_parquet("example/positions_sample.parquet") # positions (x, y, z)
48
+ out = model.predict(df) # one pred_<feature> column each
49
+ types = model.mixture_weights(df, level="type") # putative cell-type composition
50
+ subtypes = model.mixture_weights(df) # ... and of the sub-types
51
+ draws = model.sample(df, n_samples=16) # training units drawn at each position
52
+ model.selftest() # reproduces the shipped outputs
53
+ ```
54
+
55
+ Units you recorded yourself can be embedded with `model.encode(waveform, acg, stpc)` (arrays shaped
56
+ as in `config.json`), then assigned to a putative cell type and sub-type with `model.assign(z)`.
57
+
58
+ ## What ships here
59
+
60
+ - `autoencoder.pt`, `shared_latent_scaler.joblib` -- the phenotype encoder and its latent scaler.
61
+ - `types_gmm.joblib`, `subtypes_gmm.joblib`, `subtype_parent.npy` -- the types, the sub-types and
62
+ the type of each sub-type.
63
+ - `context_transform.joblib`, `context_weights_types.pt`, `context_weights_subtypes.pt` -- context
64
+ -> type and sub-type weights.
65
+ - `members.npz` -- the phenotype features of the training units and their sub-type posteriors
66
+ (the readout; part of the model, like the stored points of any nearest-neighbour model).
67
+ - `agea_vol_pca.npy`, `merfish_vol_pca.npy` -- the molecular and cellular context volumes, the same frozen
68
+ volumes as the channel-level model `int-brain-lab/ea-encoder-channel@0.0.1`.
69
+ - `split.json`, `config.json`, `preprocessing/unit_stats.npz`, `results/` -- the probe split, the
70
+ training configuration, the training-data statistics and held-out evaluation summaries.
71
+
72
+ The recorded per-unit dataset (waveforms, ACGs, positions) is **not** here: it stays on IBL S3 and
73
+ is only needed to retrain the model or to reproduce the atlas-wide analyses.
74
+
75
+ > **First run downloads the Allen volume.** Sampling the context constructs an `AllenAtlas`, which
76
+ > fetches the Allen CCF volume (public, no account, a few hundred MB) once per machine.
77
+
78
+ ## Reproducibility
79
+
80
+ **Pin the revision.** `revision="0.0.1"` is an immutable tag; omitting it resolves to `main`,
81
+ which tracks the currently recommended model. `ephysatlas_model.json` records the training-time
82
+ environment and random seed; `model.selftest()` verifies your install reproduces the shipped
83
+ output (no IBL account needed).
84
+
85
+ ## Citation
86
+
87
+ Please cite ELECTRA, the IBL Electrophysiological Reference Atlas. Model `int-brain-lab/ea-encoder-unit`, version
88
+ `0.0.1`, data release `2026_W42`.
checksums.json CHANGED
@@ -1,115 +1,115 @@
1
- {
2
- "algo": "sha1",
3
- "files": [
4
- {
5
- "path": "agea_vol_pca.npy",
6
- "hash": "b710b6b26797e78bbc49762e80f2ae5ab6bb3896",
7
- "bytes": 31865328
8
- },
9
- {
10
- "path": "autoencoder.pt",
11
- "hash": "f2042bd100bf1bb93a2bc51605fddd4f82e842d4",
12
- "bytes": 22722021
13
- },
14
- {
15
- "path": "config.json",
16
- "hash": "6c901c0ba3ba72d22a2da744f0ec4f5c6364b1cd",
17
- "bytes": 2205
18
- },
19
- {
20
- "path": "context_transform.joblib",
21
- "hash": "4a5fc05d66c6c14e7b60059dca30d0deac2dcd16",
22
- "bytes": 3049
23
- },
24
- {
25
- "path": "context_weights_subtypes.pt",
26
- "hash": "126287757317f1622a97c5264b1f06adeaa30f13",
27
- "bytes": 211105
28
- },
29
- {
30
- "path": "context_weights_types.pt",
31
- "hash": "c2d37e614a25ef6b80b35cafde77023339f11646",
32
- "bytes": 71613
33
- },
34
- {
35
- "path": "ephysatlas_model.json",
36
- "hash": "846fca0efe3e9bdc9507918837f229389a3e47e5",
37
- "bytes": 3319
38
- },
39
- {
40
- "path": "example/expected_latents.npy",
41
- "hash": "72baab09c0a16c5b5971266e214659e6d815e7aa",
42
- "bytes": 3968
43
- },
44
- {
45
- "path": "example/expected_predictions.parquet",
46
- "hash": "5525d7f2278cb40cea6365bd4b103f7bfe8e54f1",
47
- "bytes": 32740
48
- },
49
- {
50
- "path": "example/positions_sample.parquet",
51
- "hash": "4ab9f9e16a8f05ea2dacbfa8d499d223eb0f7253",
52
- "bytes": 10081
53
- },
54
- {
55
- "path": "example/units_sample.npz",
56
- "hash": "354e646ae7c36cdb81e3eae204e07df291490408",
57
- "bytes": 303532
58
- },
59
- {
60
- "path": "hierarchy_summary.json",
61
- "hash": "12ca89d0b8301afc1b8b9f960c16bc5e5098d67c",
62
- "bytes": 1573
63
- },
64
- {
65
- "path": "members.npz",
66
- "hash": "af56151236158d8a25340be31b3528c33ebfa802",
67
- "bytes": 3716096
68
- },
69
- {
70
- "path": "merfish_vol_pca.npy",
71
- "hash": "c8fd5484d8c0619c5c542242c9ac99876db56892",
72
- "bytes": 31865328
73
- },
74
- {
75
- "path": "preprocessing/unit_stats.npz",
76
- "hash": "8b59ba1d57b524352f83b3bc8107ecb2643af5c3",
77
- "bytes": 5935
78
- },
79
- {
80
- "path": "results/summary.json",
81
- "hash": "865b12673774571c6edf28a3f8a8bc26f1c2224a",
82
- "bytes": 2212
83
- },
84
- {
85
- "path": "shared_latent_scaler.joblib",
86
- "hash": "b8a1f21c6a2083d941d98cde9b3b0b3e6f61aeb9",
87
- "bytes": 2023
88
- },
89
- {
90
- "path": "split.json",
91
- "hash": "2a49a2a7917d2f445e63a9e97bf8621942864dc8",
92
- "bytes": 46188
93
- },
94
- {
95
- "path": "subtype_parent.npy",
96
- "hash": "548469f659f96181124fc77bca7468d2398fc1bd",
97
- "bytes": 2528
98
- },
99
- {
100
- "path": "subtypes_gmm.joblib",
101
- "hash": "ea3fc7b0c1d859d18e9f90b5b8a68f1f06ac67ad",
102
- "bytes": 17427276
103
- },
104
- {
105
- "path": "training_summary.json",
106
- "hash": "912e5ea10d39461472e04af1fef9b3a7ed23f470",
107
- "bytes": 25271
108
- },
109
- {
110
- "path": "types_gmm.joblib",
111
- "hash": "12c925cc8d881c7ce6eea55343b4f09551aa33a9",
112
- "bytes": 2609830
113
- }
114
- ]
115
- }
 
1
+ {
2
+ "algo": "sha1",
3
+ "files": [
4
+ {
5
+ "path": "agea_vol_pca.npy",
6
+ "hash": "b710b6b26797e78bbc49762e80f2ae5ab6bb3896",
7
+ "bytes": 31865328
8
+ },
9
+ {
10
+ "path": "autoencoder.pt",
11
+ "hash": "f2042bd100bf1bb93a2bc51605fddd4f82e842d4",
12
+ "bytes": 22722021
13
+ },
14
+ {
15
+ "path": "config.json",
16
+ "hash": "1e53ec86e8e3b677f26041007d6691372850fe57",
17
+ "bytes": 2093
18
+ },
19
+ {
20
+ "path": "context_transform.joblib",
21
+ "hash": "4a5fc05d66c6c14e7b60059dca30d0deac2dcd16",
22
+ "bytes": 3049
23
+ },
24
+ {
25
+ "path": "context_weights_subtypes.pt",
26
+ "hash": "126287757317f1622a97c5264b1f06adeaa30f13",
27
+ "bytes": 211105
28
+ },
29
+ {
30
+ "path": "context_weights_types.pt",
31
+ "hash": "c2d37e614a25ef6b80b35cafde77023339f11646",
32
+ "bytes": 71613
33
+ },
34
+ {
35
+ "path": "ephysatlas_model.json",
36
+ "hash": "abf222670473f22a6076687f991540e26c5fa7f5",
37
+ "bytes": 3164
38
+ },
39
+ {
40
+ "path": "example/expected_latents.npy",
41
+ "hash": "6479e7598c4ff4b00a56400e190848cbd5aa0e2a",
42
+ "bytes": 3968
43
+ },
44
+ {
45
+ "path": "example/expected_predictions.parquet",
46
+ "hash": "5f452aa777c6200dafed4ba2c93159c729cd9769",
47
+ "bytes": 32740
48
+ },
49
+ {
50
+ "path": "example/positions_sample.parquet",
51
+ "hash": "4ab9f9e16a8f05ea2dacbfa8d499d223eb0f7253",
52
+ "bytes": 10081
53
+ },
54
+ {
55
+ "path": "example/units_sample.npz",
56
+ "hash": "cabf82e64157583e7c3c70064cb69bdb2dd4f36a",
57
+ "bytes": 303532
58
+ },
59
+ {
60
+ "path": "hierarchy_summary.json",
61
+ "hash": "12ca89d0b8301afc1b8b9f960c16bc5e5098d67c",
62
+ "bytes": 1573
63
+ },
64
+ {
65
+ "path": "members.npz",
66
+ "hash": "af56151236158d8a25340be31b3528c33ebfa802",
67
+ "bytes": 3716096
68
+ },
69
+ {
70
+ "path": "merfish_vol_pca.npy",
71
+ "hash": "c8fd5484d8c0619c5c542242c9ac99876db56892",
72
+ "bytes": 31865328
73
+ },
74
+ {
75
+ "path": "preprocessing/unit_stats.npz",
76
+ "hash": "8b59ba1d57b524352f83b3bc8107ecb2643af5c3",
77
+ "bytes": 5935
78
+ },
79
+ {
80
+ "path": "results/summary.json",
81
+ "hash": "37895dbaa68f9a64c6297065868d59661ce37cee",
82
+ "bytes": 2154
83
+ },
84
+ {
85
+ "path": "shared_latent_scaler.joblib",
86
+ "hash": "b8a1f21c6a2083d941d98cde9b3b0b3e6f61aeb9",
87
+ "bytes": 2023
88
+ },
89
+ {
90
+ "path": "split.json",
91
+ "hash": "2a49a2a7917d2f445e63a9e97bf8621942864dc8",
92
+ "bytes": 46188
93
+ },
94
+ {
95
+ "path": "subtype_parent.npy",
96
+ "hash": "548469f659f96181124fc77bca7468d2398fc1bd",
97
+ "bytes": 2528
98
+ },
99
+ {
100
+ "path": "subtypes_gmm.joblib",
101
+ "hash": "ea3fc7b0c1d859d18e9f90b5b8a68f1f06ac67ad",
102
+ "bytes": 17427276
103
+ },
104
+ {
105
+ "path": "training_summary.json",
106
+ "hash": "912e5ea10d39461472e04af1fef9b3a7ed23f470",
107
+ "bytes": 25271
108
+ },
109
+ {
110
+ "path": "types_gmm.joblib",
111
+ "hash": "12c925cc8d881c7ce6eea55343b4f09551aa33a9",
112
+ "bytes": 2609830
113
+ }
114
+ ]
115
+ }
config.json CHANGED
@@ -1,80 +1,80 @@
1
- {
2
- "seed": 0,
3
- "project": "ibl_neuropixel_brainwide_01_2026_W41",
4
- "vintage": "2026_W41",
5
- "channel_model": "C:/Users/bodic/ephys-atlas/results/releases/ea-encoder-channel/0.0.1_encoder",
6
- "force_reprepare_data": false,
7
- "prepare_data_if_missing": true,
8
- "use_acg": true,
9
- "use_stpc": true,
10
- "modality_latent_dim": 20,
11
- "waveform_shape": [
12
- 20,
13
- 128
14
- ],
15
- "acg_shape": [
16
- 10,
17
- 201
18
- ],
19
- "stpc_shape": [
20
- 161
21
- ],
22
- "ae_batch_size": 512,
23
- "eval_batch_size": 1024,
24
- "ae_epochs": 60,
25
- "ae_learning_rate": 0.0002,
26
- "ae_weight_decay": 0.0001,
27
- "ae_patience": 8,
28
- "ae_min_delta": 1e-05,
29
- "grad_clip": 5.0,
30
- "num_workers": 0,
31
- "latent_std_target": 0.5,
32
- "lambda_latent_variance": 0.05,
33
- "lambda_latent_covariance": 0.002,
34
- "feature_fidelity": false,
35
- "feature_fidelity_hidden_dim": 128,
36
- "lambda_feature_continuous": 0.25,
37
- "lambda_feature_polarity": 0.1,
38
- "n_types": 30,
39
- "max_subtypes": 10,
40
- "min_units_per_subtype": 20,
41
- "type_n_init": 1,
42
- "subtype_n_init": 3,
43
- "gmm_reg_covar": 0.0001,
44
- "gmm_max_iter": 500,
45
- "n_cell_pcs": 50,
46
- "n_gene_pcs": 50,
47
- "context_hidden_dim": 128,
48
- "context_layers": 2,
49
- "context_dropout": 0.1,
50
- "context_weight_epochs": 80,
51
- "context_weight_batch_size": 2048,
52
- "context_weight_lr": 0.0003,
53
- "context_weight_decay": 0.0001,
54
- "context_weight_patience": 10,
55
- "rare_component_power": 0.5,
56
- "rare_component_weight_cap": 10.0,
57
- "mirror_x_to_single_hemisphere": true,
58
- "mirror_x_sign": -1.0,
59
- "region_gaussian_variance_floor": 0.001,
60
- "kde_neighbors": 128,
61
- "kde_spatial_bandwidth_um": 350.0,
62
- "kde_latent_bandwidth": 0.55,
63
- "waveform_sampling_rate_hz": 30000.0,
64
- "diagnostic_examples": 16,
65
- "diagnostic_hist_bins": 40,
66
- "diagnostic_samples_per_region": 3000,
67
- "diagnostic_slice_quantiles": [
68
- 0.2,
69
- 0.5,
70
- 0.8
71
- ],
72
- "diagnostic_voxel_size_um": 100.0,
73
- "diagnostic_feature_slice_cmap": "seismic",
74
- "max_regions_in_distribution_plot": 16,
75
- "feature_slice_count": 5,
76
- "feature_slice_seed": 20260831,
77
- "feature_nll_samples_per_test_unit": 4,
78
- "feature_nll_min_bandwidth_fraction": 0.02,
79
- "feature_categorical_alpha": 1.0
80
- }
 
1
+ {
2
+ "seed": 0,
3
+ "project": "ibl_neuropixel_brainwide_01_2026_W41",
4
+ "channel_model": "int-brain-lab/ea-encoder-channel",
5
+ "force_reprepare_data": false,
6
+ "prepare_data_if_missing": true,
7
+ "use_acg": true,
8
+ "use_stpc": true,
9
+ "modality_latent_dim": 20,
10
+ "waveform_shape": [
11
+ 20,
12
+ 128
13
+ ],
14
+ "acg_shape": [
15
+ 10,
16
+ 201
17
+ ],
18
+ "stpc_shape": [
19
+ 161
20
+ ],
21
+ "ae_batch_size": 512,
22
+ "eval_batch_size": 1024,
23
+ "ae_epochs": 60,
24
+ "ae_learning_rate": 0.0002,
25
+ "ae_weight_decay": 0.0001,
26
+ "ae_patience": 8,
27
+ "ae_min_delta": 1e-05,
28
+ "grad_clip": 5.0,
29
+ "num_workers": 0,
30
+ "latent_std_target": 0.5,
31
+ "lambda_latent_variance": 0.05,
32
+ "lambda_latent_covariance": 0.002,
33
+ "feature_fidelity": false,
34
+ "feature_fidelity_hidden_dim": 128,
35
+ "lambda_feature_continuous": 0.25,
36
+ "lambda_feature_polarity": 0.1,
37
+ "n_types": 30,
38
+ "max_subtypes": 10,
39
+ "min_units_per_subtype": 20,
40
+ "type_n_init": 1,
41
+ "subtype_n_init": 3,
42
+ "gmm_reg_covar": 0.0001,
43
+ "gmm_max_iter": 500,
44
+ "n_cell_pcs": 50,
45
+ "n_gene_pcs": 50,
46
+ "context_hidden_dim": 128,
47
+ "context_layers": 2,
48
+ "context_dropout": 0.1,
49
+ "context_weight_epochs": 80,
50
+ "context_weight_batch_size": 2048,
51
+ "context_weight_lr": 0.0003,
52
+ "context_weight_decay": 0.0001,
53
+ "context_weight_patience": 10,
54
+ "rare_component_power": 0.5,
55
+ "rare_component_weight_cap": 10.0,
56
+ "mirror_x_to_single_hemisphere": true,
57
+ "mirror_x_sign": -1.0,
58
+ "region_gaussian_variance_floor": 0.001,
59
+ "kde_neighbors": 128,
60
+ "kde_spatial_bandwidth_um": 350.0,
61
+ "kde_latent_bandwidth": 0.55,
62
+ "waveform_sampling_rate_hz": 30000.0,
63
+ "diagnostic_examples": 16,
64
+ "diagnostic_hist_bins": 40,
65
+ "diagnostic_samples_per_region": 3000,
66
+ "diagnostic_slice_quantiles": [
67
+ 0.2,
68
+ 0.5,
69
+ 0.8
70
+ ],
71
+ "diagnostic_voxel_size_um": 100.0,
72
+ "diagnostic_feature_slice_cmap": "seismic",
73
+ "max_regions_in_distribution_plot": 16,
74
+ "feature_slice_count": 5,
75
+ "feature_slice_seed": 20260831,
76
+ "feature_nll_samples_per_test_unit": 4,
77
+ "feature_nll_min_bandwidth_fraction": 0.02,
78
+ "feature_categorical_alpha": 1.0,
79
+ "channel_model_revision": "0.0.1"
80
+ }
ephysatlas_model.json CHANGED
@@ -1,119 +1,119 @@
1
- {
2
- "model_id": "0.0.1_unit",
3
- "task": "unit-encoding",
4
- "model_class": "UnitAutoencoder",
5
- "vintage": "0.0.1",
6
- "training": {
7
- "random_seed": 0,
8
- "training_size": 724,
9
- "training_units": 70564,
10
- "validation_size": 96,
11
- "validation_units": 11052,
12
- "testing_size": 198,
13
- "testing_units": 20206
14
- },
15
- "environment": {
16
- "python": "3.11.9",
17
- "xgboost": "3.2.0",
18
- "scikit_learn": "1.8.0",
19
- "numpy": "2.3.5",
20
- "pandas": "2.3.3",
21
- "torch": "2.7.1+cu118",
22
- "ephysatlas": "0.9.0",
23
- "iblatlas": "1.3.1"
24
- },
25
- "method": "hierarchical_gmm",
26
- "granularity": "unit",
27
- "artifacts": {
28
- "autoencoder": "autoencoder.pt",
29
- "config": "config.json",
30
- "scaler": "shared_latent_scaler.joblib",
31
- "types": "types_gmm.joblib",
32
- "subtypes": "subtypes_gmm.joblib",
33
- "subtype_parent": "subtype_parent.npy",
34
- "context_transform": "context_transform.joblib",
35
- "type_weights": "context_weights_types.pt",
36
- "subtype_weights": "context_weights_subtypes.pt",
37
- "members": "members.npz",
38
- "stats": "preprocessing/unit_stats.npz",
39
- "split": "split.json",
40
- "context": [
41
- "agea_vol_pca.npy",
42
- "merfish_vol_pca.npy"
43
- ],
44
- "results": [
45
- "results/summary.json"
46
- ]
47
- },
48
- "inputs": {
49
- "index": [
50
- "pid",
51
- "cluster"
52
- ],
53
- "columns": [
54
- "x",
55
- "y",
56
- "z"
57
- ],
58
- "modalities": [
59
- "waveform",
60
- "acg",
61
- "stpc"
62
- ]
63
- },
64
- "outputs": {
65
- "kind": "continuous",
66
- "columns": [
67
- "depolarisation_slope",
68
- "recovery_slope",
69
- "repolarisation_slope",
70
- "spatial_spread_um",
71
- "tip_val",
72
- "spike_width_secs",
73
- "predepolarisation_width_secs",
74
- "spike_amplitude",
75
- "peak_to_trough_ratio_log",
76
- "polarity"
77
- ],
78
- "feature_order_sha256": "8536d8c5c99959110df046905224cf91de680434287153131d3ba85eaed968af",
79
- "latent_dim": 60
80
- },
81
- "config": {
82
- "architecture": {
83
- "modalities": [
84
- "waveform",
85
- "acg",
86
- "stpc"
87
- ],
88
- "modality_latent_dim": 20,
89
- "latent_dim": 60,
90
- "density": "hierarchical Gaussian mixture, full covariances, top-down assignment",
91
- "n_types": 30,
92
- "n_subtypes": 300,
93
- "max_subtypes_per_type": 10,
94
- "min_units_per_subtype": 20
95
- },
96
- "context": {
97
- "n_cell_pcs": 50,
98
- "n_gene_pcs": 50,
99
- "conditions": "the sub-type weights gamma_k(x) gamma_j|k(x) only; the type and sub-type means and covariances are global",
100
- "source_model": "C:/Users/bodic/ephys-atlas/results/releases/ea-encoder-channel/0.0.1_encoder",
101
- "data_vintage": "2026_W41"
102
- },
103
- "readout": {
104
- "method": "members",
105
- "description": "each sub-type is represented by its training units, from anywhere in the brain, weighted by their top-down posterior of the sub-type"
106
- },
107
- "preprocessing": {
108
- "waveforms": "per-unit max-abs normalized, 20 channels centred on the peak channel",
109
- "stats_file": "preprocessing/unit_stats.npz",
110
- "mirror_x_to_single_hemisphere": true,
111
- "mirror_x_sign": -1.0
112
- }
113
- },
114
- "data_source": {
115
- "backend": "s3-ibl",
116
- "project": "ibl_neuropixel_brainwide_01_2026_W41",
117
- "requires_one": true
118
- }
119
- }
 
1
+ {
2
+ "model_id": "0.0.1_unit",
3
+ "task": "unit-encoding",
4
+ "model_class": "UnitAutoencoder",
5
+ "training": {
6
+ "random_seed": 0,
7
+ "training_size": 724,
8
+ "training_units": 70564,
9
+ "validation_size": 96,
10
+ "validation_units": 11052,
11
+ "testing_size": 198,
12
+ "testing_units": 20206
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": "hierarchical_gmm",
25
+ "granularity": "unit",
26
+ "artifacts": {
27
+ "autoencoder": "autoencoder.pt",
28
+ "config": "config.json",
29
+ "scaler": "shared_latent_scaler.joblib",
30
+ "types": "types_gmm.joblib",
31
+ "subtypes": "subtypes_gmm.joblib",
32
+ "subtype_parent": "subtype_parent.npy",
33
+ "context_transform": "context_transform.joblib",
34
+ "type_weights": "context_weights_types.pt",
35
+ "subtype_weights": "context_weights_subtypes.pt",
36
+ "members": "members.npz",
37
+ "stats": "preprocessing/unit_stats.npz",
38
+ "split": "split.json",
39
+ "context": [
40
+ "agea_vol_pca.npy",
41
+ "merfish_vol_pca.npy"
42
+ ],
43
+ "results": [
44
+ "results/summary.json"
45
+ ]
46
+ },
47
+ "inputs": {
48
+ "index": [
49
+ "pid",
50
+ "cluster"
51
+ ],
52
+ "columns": [
53
+ "x",
54
+ "y",
55
+ "z"
56
+ ],
57
+ "modalities": [
58
+ "waveform",
59
+ "acg",
60
+ "stpc"
61
+ ]
62
+ },
63
+ "outputs": {
64
+ "kind": "continuous",
65
+ "columns": [
66
+ "depolarisation_slope",
67
+ "recovery_slope",
68
+ "repolarisation_slope",
69
+ "spatial_spread_um",
70
+ "tip_val",
71
+ "spike_width_secs",
72
+ "predepolarisation_width_secs",
73
+ "spike_amplitude",
74
+ "peak_to_trough_ratio_log",
75
+ "polarity"
76
+ ],
77
+ "feature_order_sha256": "8536d8c5c99959110df046905224cf91de680434287153131d3ba85eaed968af",
78
+ "latent_dim": 60
79
+ },
80
+ "config": {
81
+ "architecture": {
82
+ "modalities": [
83
+ "waveform",
84
+ "acg",
85
+ "stpc"
86
+ ],
87
+ "modality_latent_dim": 20,
88
+ "latent_dim": 60,
89
+ "density": "hierarchical Gaussian mixture, full covariances, top-down assignment",
90
+ "n_types": 30,
91
+ "n_subtypes": 300,
92
+ "max_subtypes_per_type": 10,
93
+ "min_units_per_subtype": 20
94
+ },
95
+ "context": {
96
+ "n_cell_pcs": 50,
97
+ "n_gene_pcs": 50,
98
+ "conditions": "the sub-type weights gamma_k(x) gamma_j|k(x) only; the type and sub-type means and covariances are global",
99
+ "source_model": "int-brain-lab/ea-encoder-channel@0.0.1"
100
+ },
101
+ "readout": {
102
+ "method": "members",
103
+ "description": "each sub-type is represented by its training units, from anywhere in the brain, weighted by their top-down posterior of the sub-type"
104
+ },
105
+ "preprocessing": {
106
+ "waveforms": "per-unit max-abs normalized, 20 channels centred on the peak channel",
107
+ "stats_file": "preprocessing/unit_stats.npz",
108
+ "mirror_x_to_single_hemisphere": true,
109
+ "mirror_x_sign": -1.0
110
+ }
111
+ },
112
+ "data_source": {
113
+ "backend": "s3-ibl",
114
+ "project": "ibl_neuropixel_brainwide_01_2026_W41",
115
+ "requires_one": true
116
+ },
117
+ "model_version": "0.0.1",
118
+ "data_vintage": "2026_W42"
119
+ }
example/expected_latents.npy CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:de1f78981cee686bb300f7a85719e5d8fdfef801a66dd86e3398cb8604335d3f
3
  size 3968
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f520ecb003eb5ac7f30d2cca535c3cfc0707a3187b93f77d7f91e1123bb1f24
3
  size 3968
example/expected_predictions.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5b4ca7928ad475cc28e7cd34f985cfb271e55307bad91b1795be8da8f46e2093
3
  size 32740
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:58d2bd5704237b5418a0f26dab7b2fd784f0c268a0d71589a20d902aedd4cac7
3
  size 32740
example/units_sample.npz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:736f6fb39dd5a074599547ef6a32dba114f674055e6e5a290d403459a084784f
3
  size 303532
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23ccda1afd852d04dbc94d2632f6ad56f66fe88d5f89776baad20fffcced62a5
3
  size 303532
results/summary.json CHANGED
@@ -1,60 +1,60 @@
1
- {
2
- "model_name": "hierarchical_gmm_30_types_300_subtypes",
3
- "release_tag": "0.0.1",
4
- "data_vintage": "2026_W41",
5
- "architecture": {
6
- "modalities": [
7
- "waveform",
8
- "acg",
9
- "stpc"
10
- ],
11
- "modality_latent_dim": 20,
12
- "joint_latent_dim": 60,
13
- "density": "hierarchical Gaussian mixture, full covariances",
14
- "n_types": 30,
15
- "n_subtypes": 300,
16
- "max_subtypes_per_type": 10,
17
- "min_units_per_subtype": 20,
18
- "assignment": "top-down: P(k, j | z) = P(k | z) P(j | k, z), P(j | k, z) among the sub-types of k",
19
- "context_conditioning": "sub-type weights gamma_k(x) gamma_j|k(x), from two context networks",
20
- "context_definition": "50 MERFISH PCs + 50 AGEA PCs",
21
- "phenotype_readout": "members: each sub-type's TRAIN units from anywhere in the brain, weighted by their top-down posterior of the sub-type"
22
- },
23
- "split_counts": {
24
- "train_units": 70564,
25
- "validation_units": 11052,
26
- "test_units": 20206,
27
- "train_pids": 724,
28
- "validation_pids": 96,
29
- "test_pids": 198
30
- },
31
- "heldout_basic_test": {
32
- "model": "hierarchical_gmm_30_types_300_subtypes",
33
- "split": "held-out test PIDs",
34
- "reconstruction": {
35
- "waveform_mse": 0.0008023193222470582,
36
- "acg_mse": 2.9368129617068917e-05,
37
- "stpc_mse": 0.010675105266273022,
38
- "n_test_units": 4096
39
- },
40
- "latent_nll": {
41
- "context_weights": -29.076593665156942,
42
- "brain_wide_weights": -28.435720701046566,
43
- "context_improvement": 0.6408729641103754,
44
- "n_test_units": 20206,
45
- "lower_is_better": true
46
- },
47
- "sanity_checks": {
48
- "all_metrics_finite": true,
49
- "context_beats_brain_wide": true,
50
- "subtypes_inside_types": true
51
- }
52
- },
53
- "invariants": [
54
- "TEST PIDs are never used for AE/mixture/context training or as readout members.",
55
- "The type and sub-type means and covariance matrices are global.",
56
- "Molecular context changes only the sub-type weights gamma_k(x) gamma_j|k(x).",
57
- "A unit's sub-type always lies inside its type (top-down assignment).",
58
- "Positions are folded onto one hemisphere about the atlas midline (ephysatlas.hemispheres.MIDLINE_X)."
59
- ]
60
- }
 
1
+ {
2
+ "model_name": "hierarchical_gmm_30_types_300_subtypes",
3
+ "data_vintage": "2026_W42",
4
+ "architecture": {
5
+ "modalities": [
6
+ "waveform",
7
+ "acg",
8
+ "stpc"
9
+ ],
10
+ "modality_latent_dim": 20,
11
+ "joint_latent_dim": 60,
12
+ "density": "hierarchical Gaussian mixture, full covariances",
13
+ "n_types": 30,
14
+ "n_subtypes": 300,
15
+ "max_subtypes_per_type": 10,
16
+ "min_units_per_subtype": 20,
17
+ "assignment": "top-down: P(k, j | z) = P(k | z) P(j | k, z), P(j | k, z) among the sub-types of k",
18
+ "context_conditioning": "sub-type weights gamma_k(x) gamma_j|k(x), from two context networks",
19
+ "context_definition": "50 MERFISH PCs + 50 AGEA PCs",
20
+ "phenotype_readout": "members: each sub-type's TRAIN units from anywhere in the brain, weighted by their top-down posterior of the sub-type"
21
+ },
22
+ "split_counts": {
23
+ "train_units": 70564,
24
+ "validation_units": 11052,
25
+ "test_units": 20206,
26
+ "train_pids": 724,
27
+ "validation_pids": 96,
28
+ "test_pids": 198
29
+ },
30
+ "heldout_basic_test": {
31
+ "model": "hierarchical_gmm_30_types_300_subtypes",
32
+ "split": "held-out test PIDs",
33
+ "reconstruction": {
34
+ "waveform_mse": 0.0008023193222470582,
35
+ "acg_mse": 2.9368129617068917e-05,
36
+ "stpc_mse": 0.010675105266273022,
37
+ "n_test_units": 4096
38
+ },
39
+ "latent_nll": {
40
+ "context_weights": -29.076593665156942,
41
+ "brain_wide_weights": -28.435720701046566,
42
+ "context_improvement": 0.6408729641103754,
43
+ "n_test_units": 20206,
44
+ "lower_is_better": true
45
+ },
46
+ "sanity_checks": {
47
+ "all_metrics_finite": true,
48
+ "context_beats_brain_wide": true,
49
+ "subtypes_inside_types": true
50
+ }
51
+ },
52
+ "invariants": [
53
+ "TEST PIDs are never used for AE/mixture/context training or as readout members.",
54
+ "The type and sub-type means and covariance matrices are global.",
55
+ "Molecular context changes only the sub-type weights gamma_k(x) gamma_j|k(x).",
56
+ "A unit's sub-type always lies inside its type (top-down assignment).",
57
+ "Positions are folded onto one hemisphere about the atlas midline (ephysatlas.hemispheres.MIDLINE_X)."
58
+ ],
59
+ "model_version": "0.0.1"
60
+ }