See requirements.txt. Key dependencies are pinned for reproducibility.
pip install -r requirements.txt- Data: This repository does not include datasets. Place your data under a base directory (see below).
- Model weights: Trained checkpoints are not included. To share weights for reproduction, use GitHub Releases or Zenodo and document the download path here or in the paper.
Use a single base directory (e.g. /path/to/base_dir) with this structure:
<base_dir>/
data/
raw/ # raw data
processed/ # (optional) preprocessed .pt
atlas_metadata/
logs/
output/ # model checkpoints and results
tensorboard/
git clone <your-repo-url>
cd TNA
pip install -r requirements.txt- Put your data under
<base_dir>/data/raw/(and optionally preprocessed underdata/processed/). - Put atlas metadata under
<base_dir>/data/atlas_metadata/as required by the data loaders.
From the TNA project root (the directory that contains tna/ and scripts/):
python scripts/train.py --base_dir /path/to/base_dir--base_diris required: the path to the base directory that containsdata/andlogs/.- Other arguments are optional (e.g.
--dataset,--atlas,--epochs,--batch_size,--lr,--kfold,--gpu,--seed). Omitted options use defaults fromtna.configs.model_config.TNAConfig.
Example with options:
python scripts/train.py --base_dir /path/to/base_dir --dataset REST-MDD --atlas cc200 --epochs 70 --batch_size 64 --kfold 10 --gpu 0Dual-atlas mode:
python scripts/train.py --base_dir /path/to/base_dir --dual_atlasAfter training, checkpoints are saved under <base_dir>/logs/output/<run_name>/. To evaluate:
python scripts/evaluate.py --base_dir /path/to/base_dir --checkpoint-dir /path/to/base_dir/logs/output/<run_name>Example:
python scripts/evaluate.py --base_dir /path/to/base_dir --checkpoint-dir /path/to/base_dir/logs/output/REST-MDD_cc200_20250101_120000Optional arguments: --dataset, --atlas, --kfold, --batch_size, --gpu (same as training).
To dump attention weights to a file for analysis:
export TNA_ATTN_LOG_DIR=/path/to/log/dir
python scripts/train.py --base_dir /path/to/base_dirWeights are appended to attention_weights.txt under that directory.