Push model using huggingface_hub.
Browse files- README.md +7 -61
- config.json +72 -72
README.md
CHANGED
|
@@ -1,68 +1,14 @@
|
|
| 1 |
---
|
| 2 |
library_name: braindecode
|
| 3 |
-
license:
|
| 4 |
-
pipeline_tag: feature-extraction
|
| 5 |
tags:
|
|
|
|
| 6 |
- braindecode
|
| 7 |
-
-
|
| 8 |
-
- ieeg
|
| 9 |
-
- seeg
|
| 10 |
-
- foundation-model
|
| 11 |
- pytorch_model_hub_mixin
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
[`braindecode.models.DIVER1`](https://braindecode.org/stable/generated/braindecode.models.DIVER1.html).
|
| 19 |
-
|
| 20 |
-
Source: `weights/ieeg_pretrained_weights.pt` of [DIVER-Project/DIVER-1](https://github.com/DIVER-Project/DIVER-1/tree/25638eb38ef297b582ab79ae1c96260f57c155b3),
|
| 21 |
-
sha256 `b812093779fb5cf1b76e18f8307df4136b67b008b6cd94c6be75fa286a87864c` (the GitHub LFS object is no longer served; the same file is in
|
| 22 |
-
the authors' [Google Drive folder](https://drive.google.com/drive/folders/1Wmv36jifjE0Jj6noGOFFsqRzK-4xnj1b)). Conversion casts the bfloat16
|
| 23 |
-
tensors to float32, renames them and drops the pretraining-only mask token and
|
| 24 |
-
reconstruction heads; `convert_diver1_weights.py` in this repository reproduces
|
| 25 |
-
it. Encoder features match the official model to 0.0e+00 in
|
| 26 |
-
float32 on CPU, with muP attention scaling (`mup_attention=True`).
|
| 27 |
-
|
| 28 |
-
## Usage
|
| 29 |
-
|
| 30 |
-
Resample to 500 Hz and pass the electrode positions in `chs_info` (metres, as in MNE):
|
| 31 |
-
|
| 32 |
-
```python
|
| 33 |
-
import torch
|
| 34 |
-
from braindecode.models import DIVER1
|
| 35 |
-
|
| 36 |
-
model = DIVER1.from_pretrained(
|
| 37 |
-
"braindecode/DIVER-1-0.1s-tiny", chs_info=raw.info["chs"], n_times=500, n_outputs=2
|
| 38 |
-
)
|
| 39 |
-
logits = model(torch.randn(8, len(raw.ch_names), 500))
|
| 40 |
-
```
|
| 41 |
-
|
| 42 |
-
`n_times` must be a multiple of 50. The saved geometry is 6
|
| 43 |
-
channels and 500 samples; the encoder does not depend on it, so
|
| 44 |
-
pass your own montage, `n_times` and `n_outputs` when loading.
|
| 45 |
-
|
| 46 |
-
## Limitations
|
| 47 |
-
|
| 48 |
-
These files hold the encoder only; the release has no classification head.
|
| 49 |
-
Braindecode initializes the head on load, so it needs fine-tuning, as in the
|
| 50 |
-
paper's protocol (`scripts/finetune_neuroprobe.sh`). The check above covers
|
| 51 |
-
float32 CPU encoder features, not downstream accuracy, GPU kernels or mixed
|
| 52 |
-
precision.
|
| 53 |
-
|
| 54 |
-
## Citation
|
| 55 |
-
|
| 56 |
-
```bibtex
|
| 57 |
-
@article{han2025diver,
|
| 58 |
-
title={DIVER-1: Scaling intracranial EEG foundation models for transferable representations},
|
| 59 |
-
author={Han, Danny Dongyeop and Gwon, Yonghyeon and Lee, Ahhyun Lucy and Lee, Taeyang and Lee, Seong Jin and Choi, Jubin and Lee, Sebin and Bang, Jihyun and Lee, Seungju and Park, David Keetae and Yoo, Shinjae and Chung, Chun Kee and Cha, Jiook},
|
| 60 |
-
journal={arXiv preprint arXiv:2512.19097},
|
| 61 |
-
year={2025}
|
| 62 |
-
}
|
| 63 |
-
```
|
| 64 |
-
|
| 65 |
-
## License
|
| 66 |
-
|
| 67 |
-
The weights are released by the DIVER Project under the MIT licence (`LICENSE`).
|
| 68 |
-
Braindecode's code is BSD-3-Clause.
|
|
|
|
| 1 |
---
|
| 2 |
library_name: braindecode
|
| 3 |
+
license: apache-2.0
|
|
|
|
| 4 |
tags:
|
| 5 |
+
- DIVER1
|
| 6 |
- braindecode
|
| 7 |
+
- model_hub_mixin
|
|
|
|
|
|
|
|
|
|
| 8 |
- pytorch_model_hub_mixin
|
| 9 |
---
|
| 10 |
|
| 11 |
+
This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
|
| 12 |
+
- Code: https://braindecode.org
|
| 13 |
+
- Paper: [More Information Needed]
|
| 14 |
+
- Docs: https://braindecode.org/stable/generated/braindecode.models.DIVER1.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.json
CHANGED
|
@@ -10,18 +10,18 @@
|
|
| 10 |
"cal": 1.0,
|
| 11 |
"range": 1.0,
|
| 12 |
"loc": [
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
]
|
| 26 |
},
|
| 27 |
{
|
|
@@ -32,18 +32,18 @@
|
|
| 32 |
"cal": 1.0,
|
| 33 |
"range": 1.0,
|
| 34 |
"loc": [
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
]
|
| 48 |
},
|
| 49 |
{
|
|
@@ -54,18 +54,18 @@
|
|
| 54 |
"cal": 1.0,
|
| 55 |
"range": 1.0,
|
| 56 |
"loc": [
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
]
|
| 70 |
},
|
| 71 |
{
|
|
@@ -76,18 +76,18 @@
|
|
| 76 |
"cal": 1.0,
|
| 77 |
"range": 1.0,
|
| 78 |
"loc": [
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
]
|
| 92 |
},
|
| 93 |
{
|
|
@@ -98,18 +98,18 @@
|
|
| 98 |
"cal": 1.0,
|
| 99 |
"range": 1.0,
|
| 100 |
"loc": [
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
]
|
| 114 |
},
|
| 115 |
{
|
|
@@ -120,18 +120,18 @@
|
|
| 120 |
"cal": 1.0,
|
| 121 |
"range": 1.0,
|
| 122 |
"loc": [
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
]
|
| 136 |
}
|
| 137 |
],
|
|
|
|
| 10 |
"cal": 1.0,
|
| 11 |
"range": 1.0,
|
| 12 |
"loc": [
|
| 13 |
+
0.0,
|
| 14 |
+
0.0,
|
| 15 |
+
0.0,
|
| 16 |
+
0.0,
|
| 17 |
+
0.0,
|
| 18 |
+
0.0,
|
| 19 |
+
0.0,
|
| 20 |
+
0.0,
|
| 21 |
+
0.0,
|
| 22 |
+
0.0,
|
| 23 |
+
0.0,
|
| 24 |
+
0.0
|
| 25 |
]
|
| 26 |
},
|
| 27 |
{
|
|
|
|
| 32 |
"cal": 1.0,
|
| 33 |
"range": 1.0,
|
| 34 |
"loc": [
|
| 35 |
+
0.0,
|
| 36 |
+
0.0,
|
| 37 |
+
0.0,
|
| 38 |
+
0.0,
|
| 39 |
+
0.0,
|
| 40 |
+
0.0,
|
| 41 |
+
0.0,
|
| 42 |
+
0.0,
|
| 43 |
+
0.0,
|
| 44 |
+
0.0,
|
| 45 |
+
0.0,
|
| 46 |
+
0.0
|
| 47 |
]
|
| 48 |
},
|
| 49 |
{
|
|
|
|
| 54 |
"cal": 1.0,
|
| 55 |
"range": 1.0,
|
| 56 |
"loc": [
|
| 57 |
+
0.0,
|
| 58 |
+
0.0,
|
| 59 |
+
0.0,
|
| 60 |
+
0.0,
|
| 61 |
+
0.0,
|
| 62 |
+
0.0,
|
| 63 |
+
0.0,
|
| 64 |
+
0.0,
|
| 65 |
+
0.0,
|
| 66 |
+
0.0,
|
| 67 |
+
0.0,
|
| 68 |
+
0.0
|
| 69 |
]
|
| 70 |
},
|
| 71 |
{
|
|
|
|
| 76 |
"cal": 1.0,
|
| 77 |
"range": 1.0,
|
| 78 |
"loc": [
|
| 79 |
+
0.0,
|
| 80 |
+
0.0,
|
| 81 |
+
0.0,
|
| 82 |
+
0.0,
|
| 83 |
+
0.0,
|
| 84 |
+
0.0,
|
| 85 |
+
0.0,
|
| 86 |
+
0.0,
|
| 87 |
+
0.0,
|
| 88 |
+
0.0,
|
| 89 |
+
0.0,
|
| 90 |
+
0.0
|
| 91 |
]
|
| 92 |
},
|
| 93 |
{
|
|
|
|
| 98 |
"cal": 1.0,
|
| 99 |
"range": 1.0,
|
| 100 |
"loc": [
|
| 101 |
+
0.0,
|
| 102 |
+
0.0,
|
| 103 |
+
0.0,
|
| 104 |
+
0.0,
|
| 105 |
+
0.0,
|
| 106 |
+
0.0,
|
| 107 |
+
0.0,
|
| 108 |
+
0.0,
|
| 109 |
+
0.0,
|
| 110 |
+
0.0,
|
| 111 |
+
0.0,
|
| 112 |
+
0.0
|
| 113 |
]
|
| 114 |
},
|
| 115 |
{
|
|
|
|
| 120 |
"cal": 1.0,
|
| 121 |
"range": 1.0,
|
| 122 |
"loc": [
|
| 123 |
+
0.0,
|
| 124 |
+
0.0,
|
| 125 |
+
0.0,
|
| 126 |
+
0.0,
|
| 127 |
+
0.0,
|
| 128 |
+
0.0,
|
| 129 |
+
0.0,
|
| 130 |
+
0.0,
|
| 131 |
+
0.0,
|
| 132 |
+
0.0,
|
| 133 |
+
0.0,
|
| 134 |
+
0.0
|
| 135 |
]
|
| 136 |
}
|
| 137 |
],
|