MedSpaformer: a Transferable Multi-granularity Transformer with Token Sparsification for Medical Time Series Classification

December 8, 2025 ยท View on GitHub

This code is the official implementation of Sparseformer.

Installation

pip install -r requirements.txt

Datasets

Please download the experimental datasets via the following link: Please put the experimental datasets into the Data folder.

Replace the text_dir in "pkl_dir": ".../Data/EEG/APAVA/Pkl", "text_emb_dir": ".../Data/EEG/APAVA/text_emb",

Experiment

For supervised learning experiments, please run the followings:

sh APAVA.sh