File size: 1,663 Bytes
d37c079 | 1 2 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 | #!/usr/bin/env bash
# Clone EEG foundation-model repos and fetch pretrained weights.
# Works on the M5 Mac (inference via MPS) or the GPU server.
# Run from repo root: bash src/foundation/setup_foundation.sh
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
FM_DIR="$ROOT/third_party"
CKPT_DIR="$ROOT/checkpoints"
mkdir -p "$FM_DIR" "$CKPT_DIR"
echo "== EEGPT (NeurIPS 2024, 10M params, strong MI linear-probe) =="
[ -d "$FM_DIR/EEGPT" ] || git clone --depth 1 https://github.com/BINE022/EEGPT "$FM_DIR/EEGPT"
echo " -> checkpoint (eegpt_mcae_58chs_4s_large4E.ckpt) is linked from the EEGPT repo README"
echo " (Google Drive / release). Download it into: $CKPT_DIR/"
echo "== CBraMod (ICLR 2025, MIT, criss-cross, channel-flexible) =="
[ -d "$FM_DIR/CBraMod" ] || git clone --depth 1 https://github.com/wjq-learning/CBraMod "$FM_DIR/CBraMod"
if command -v huggingface-cli >/dev/null 2>&1; then
huggingface-cli download weighting666/CBraMod pretrained_weights.pth \
--local-dir "$CKPT_DIR/CBraMod" || echo " (hf download failed — grab manually from HF)"
else
echo " -> pip install huggingface_hub, then:"
echo " huggingface-cli download weighting666/CBraMod pretrained_weights.pth --local-dir $CKPT_DIR/CBraMod"
fi
echo "== LaBraM (ICLR 2024 spotlight, channel-name embeddings) =="
[ -d "$FM_DIR/LaBraM" ] || git clone --depth 1 https://github.com/935963004/LaBraM "$FM_DIR/LaBraM"
echo " -> checkpoints/labram-base.pth ships in the repo."
echo
echo "Done. Repos in $FM_DIR, weights in $CKPT_DIR."
echo "Next: extract frozen embeddings on MOABB MI data and fit a linear probe"
echo " (see src/foundation/README.md)."
|