Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Add the EEGPT backbone ([#40](https://github.com/braindecode/OpenEEGBench/pull/40)).

## [0.5.0] - 2026-05-28

Expand Down
20 changes: 20 additions & 0 deletions open_eeg_bench/backbone_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import numpy as np
from braindecode.models import EEGPT, InterpolatedModel
from braindecode.models.eegpt import EEGPT_CHANNELS
from mne.channels import make_standard_montage

montage = make_standard_montage("standard_1020")
ch_pos = {
ch.upper(): (ch, loc) for ch, loc in montage.get_positions()["ch_pos"].items()
}
_EEGPT_TARGET_CHS_INFO = [
{
"ch_name": ch_pos[ch.upper()][0],
"kind": "eeg",
"loc": ch_pos[ch.upper()][1],
}
for ch in EEGPT_CHANNELS
]
InterpolatedEEGPT = InterpolatedModel(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary only until we have a Braindecode release that includes InterpolatedEEGPT

EEGPT, _EEGPT_TARGET_CHS_INFO, name="InterpolatedEEGPT"
)
15 changes: 15 additions & 0 deletions open_eeg_bench/default_configs/backbones.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,26 @@ def reve(**overrides) -> PretrainedBackbone:
return PretrainedBackbone(**defaults)


def eegpt(**overrides) -> PretrainedBackbone:
defaults = dict(
# model_cls="braindecode.models.EEGPT",
# model_cls="braindecode.models.InterpolatedEEGPT",
model_cls="open_eeg_bench.backbone_utils.InterpolatedEEGPT",
model_kwargs={"chan_proj_type": "none", "n_chans_target": 19},
peft_ff_modules=["qkv", "fc1", "fc2"],
normalization=WindowZScore(),
hub_repo="braindecode/eegpt-pretrained",
)
defaults.update(overrides)
return PretrainedBackbone(**defaults)


ALL_BACKBONES = {
"biot": biot,
"labram": labram,
"bendr": bendr,
"cbramod": cbramod,
"signal_jepa": signal_jepa,
"reve": reve,
"eegpt": eegpt,
}
Loading