Publish 0.0.1
Browse files- LICENSE +6 -6
- README.md +88 -88
- checksums.json +115 -115
- config.json +80 -80
- ephysatlas_model.json +119 -119
- example/expected_latents.npy +1 -1
- example/expected_predictions.parquet +1 -1
- example/units_sample.npz +1 -1
- results/summary.json +60 -60
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 `
|
| 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 `
|
| 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 `
|
|
|
|
| 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": "
|
| 17 |
-
"bytes":
|
| 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": "
|
| 37 |
-
"bytes":
|
| 38 |
-
},
|
| 39 |
-
{
|
| 40 |
-
"path": "example/expected_latents.npy",
|
| 41 |
-
"hash": "
|
| 42 |
-
"bytes": 3968
|
| 43 |
-
},
|
| 44 |
-
{
|
| 45 |
-
"path": "example/expected_predictions.parquet",
|
| 46 |
-
"hash": "
|
| 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": "
|
| 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": "
|
| 82 |
-
"bytes":
|
| 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 |
-
"
|
| 5 |
-
"
|
| 6 |
-
"
|
| 7 |
-
"
|
| 8 |
-
"
|
| 9 |
-
"
|
| 10 |
-
"
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
"
|
| 23 |
-
"
|
| 24 |
-
"
|
| 25 |
-
"
|
| 26 |
-
"
|
| 27 |
-
"
|
| 28 |
-
"
|
| 29 |
-
"
|
| 30 |
-
"
|
| 31 |
-
"
|
| 32 |
-
"
|
| 33 |
-
"
|
| 34 |
-
"
|
| 35 |
-
"
|
| 36 |
-
"
|
| 37 |
-
"
|
| 38 |
-
"
|
| 39 |
-
"
|
| 40 |
-
"
|
| 41 |
-
"
|
| 42 |
-
"
|
| 43 |
-
"
|
| 44 |
-
"
|
| 45 |
-
"
|
| 46 |
-
"
|
| 47 |
-
"
|
| 48 |
-
"
|
| 49 |
-
"
|
| 50 |
-
"
|
| 51 |
-
"
|
| 52 |
-
"
|
| 53 |
-
"
|
| 54 |
-
"
|
| 55 |
-
"
|
| 56 |
-
"
|
| 57 |
-
"
|
| 58 |
-
"
|
| 59 |
-
"
|
| 60 |
-
"
|
| 61 |
-
"
|
| 62 |
-
"
|
| 63 |
-
"
|
| 64 |
-
"
|
| 65 |
-
"
|
| 66 |
-
"
|
| 67 |
-
|
| 68 |
-
0.
|
| 69 |
-
0.
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
"
|
| 73 |
-
"
|
| 74 |
-
"
|
| 75 |
-
"
|
| 76 |
-
"
|
| 77 |
-
"
|
| 78 |
-
"
|
| 79 |
-
"
|
| 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 |
-
"
|
| 6 |
-
|
| 7 |
-
"
|
| 8 |
-
"
|
| 9 |
-
"
|
| 10 |
-
"
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
"
|
| 17 |
-
"
|
| 18 |
-
"
|
| 19 |
-
"
|
| 20 |
-
"
|
| 21 |
-
"
|
| 22 |
-
"
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
"
|
| 26 |
-
"
|
| 27 |
-
|
| 28 |
-
"
|
| 29 |
-
"
|
| 30 |
-
"
|
| 31 |
-
"
|
| 32 |
-
"
|
| 33 |
-
"
|
| 34 |
-
"
|
| 35 |
-
"
|
| 36 |
-
"
|
| 37 |
-
"
|
| 38 |
-
"
|
| 39 |
-
"
|
| 40 |
-
|
| 41 |
-
"
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
"
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
"
|
| 55 |
-
"
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
"
|
| 60 |
-
"
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
"
|
| 66 |
-
|
| 67 |
-
"
|
| 68 |
-
"
|
| 69 |
-
"
|
| 70 |
-
"
|
| 71 |
-
"
|
| 72 |
-
"
|
| 73 |
-
"
|
| 74 |
-
"
|
| 75 |
-
"
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
"
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
"
|
| 85 |
-
"
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
"
|
| 89 |
-
"
|
| 90 |
-
"
|
| 91 |
-
"
|
| 92 |
-
"
|
| 93 |
-
"
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
"
|
| 98 |
-
"
|
| 99 |
-
"
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
"
|
| 109 |
-
"
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
"
|
| 116 |
-
|
| 117 |
-
|
| 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:
|
| 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:
|
| 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:
|
| 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 |
-
"
|
| 4 |
-
"
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
"
|
| 8 |
-
"
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
"
|
| 14 |
-
"
|
| 15 |
-
"
|
| 16 |
-
"
|
| 17 |
-
"
|
| 18 |
-
"
|
| 19 |
-
"
|
| 20 |
-
"
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
"
|
| 25 |
-
"
|
| 26 |
-
"
|
| 27 |
-
"
|
| 28 |
-
"
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
"
|
| 33 |
-
"
|
| 34 |
-
|
| 35 |
-
"
|
| 36 |
-
"
|
| 37 |
-
"
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
"
|
| 42 |
-
"
|
| 43 |
-
"
|
| 44 |
-
"
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
"
|
| 49 |
-
"
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
"
|
| 55 |
-
"
|
| 56 |
-
"
|
| 57 |
-
"
|
| 58 |
-
|
| 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 |
+
}
|