Publish 0.0.1
Browse files- LICENSE +6 -6
- README.md +118 -118
- checksums.json +65 -65
- ephysatlas_model.json +275 -274
- 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": "
|
| 17 |
-
"bytes":
|
| 18 |
-
},
|
| 19 |
-
{
|
| 20 |
-
"path": "example/expected_predictions.parquet",
|
| 21 |
-
"hash": "
|
| 22 |
-
"bytes":
|
| 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 |
-
"
|
| 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 |
-
"results/
|
| 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 |
-
|
| 120 |
-
"
|
| 121 |
-
"
|
| 122 |
-
"
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
"
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
"
|
| 139 |
-
"
|
| 140 |
-
"
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
"
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
"
|
| 150 |
-
"
|
| 151 |
-
"
|
| 152 |
-
"
|
| 153 |
-
"
|
| 154 |
-
"
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
"
|
| 159 |
-
"
|
| 160 |
-
"
|
| 161 |
-
"
|
| 162 |
-
"
|
| 163 |
-
"
|
| 164 |
-
"
|
| 165 |
-
"
|
| 166 |
-
"
|
| 167 |
-
"
|
| 168 |
-
"
|
| 169 |
-
"
|
| 170 |
-
"
|
| 171 |
-
"
|
| 172 |
-
"
|
| 173 |
-
"
|
| 174 |
-
"
|
| 175 |
-
"
|
| 176 |
-
"
|
| 177 |
-
"
|
| 178 |
-
"
|
| 179 |
-
"
|
| 180 |
-
"
|
| 181 |
-
"
|
| 182 |
-
"
|
| 183 |
-
"
|
| 184 |
-
"
|
| 185 |
-
"
|
| 186 |
-
"
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
"
|
| 192 |
-
"
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
"
|
| 197 |
-
"
|
| 198 |
-
"
|
| 199 |
-
"
|
| 200 |
-
"
|
| 201 |
-
"
|
| 202 |
-
"
|
| 203 |
-
"
|
| 204 |
-
"
|
| 205 |
-
"
|
| 206 |
-
"
|
| 207 |
-
"
|
| 208 |
-
"
|
| 209 |
-
"
|
| 210 |
-
"
|
| 211 |
-
"
|
| 212 |
-
"
|
| 213 |
-
"
|
| 214 |
-
"
|
| 215 |
-
"
|
| 216 |
-
"
|
| 217 |
-
"
|
| 218 |
-
"
|
| 219 |
-
"
|
| 220 |
-
"
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
"
|
| 224 |
-
"
|
| 225 |
-
"
|
| 226 |
-
"
|
| 227 |
-
"
|
| 228 |
-
"
|
| 229 |
-
"
|
| 230 |
-
"
|
| 231 |
-
"
|
| 232 |
-
"
|
| 233 |
-
"
|
| 234 |
-
"
|
| 235 |
-
"
|
| 236 |
-
"
|
| 237 |
-
"
|
| 238 |
-
"
|
| 239 |
-
"
|
| 240 |
-
"
|
| 241 |
-
"
|
| 242 |
-
"
|
| 243 |
-
"
|
| 244 |
-
"
|
| 245 |
-
"
|
| 246 |
-
"
|
| 247 |
-
"
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
"
|
| 252 |
-
"
|
| 253 |
-
"
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
"
|
| 258 |
-
"
|
| 259 |
-
"
|
| 260 |
-
"
|
| 261 |
-
"
|
| 262 |
-
"
|
| 263 |
-
"
|
| 264 |
-
"
|
| 265 |
-
"
|
| 266 |
-
"
|
| 267 |
-
"
|
| 268 |
-
"
|
| 269 |
-
|
| 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:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2a0075d4f5035527e880eb3e1be4528701cde07931259570224812f00d62a1ad
|
| 3 |
+
size 155677
|