LNPBench / code /scripts /run_all_gpu.sh
eduzrh's picture
LNPBench: code, caches, results and figures
56a9a7d verified
Raw History Blame
4.23 kB
#!/usr/bin/env bash
# The exact experiment matrix reported in the paper.
#
# bash scripts/run_all_gpu.sh # every phase, in order
# bash scripts/run_all_gpu.sh 3 4 # only the proposed models + ablations
#
# Phases are resumable: run_benchmark.py --resume skips tasks already present in
# the output CSV, so a killed run can be restarted with the same command.
set -u
export PYTHONPATH=src
export OMP_NUM_THREADS=4
PHASES=${@:-1 2 3 4 5 6}
OUT=results
run_phase1() { # tabular baselines, 5 folds x 4 held-out studies (CPU)
python scripts/run_benchmark.py --models xgboost randomforest extratrees mlp_fp \
--protocols external --device cpu --resume --save-preds \
--out ${OUT}/benchmark_classical.csv
}
run_phase2() { # message-passing baselines, 3 seeds, full 20-task matrix
for m in lion agile; do
python scripts/run_benchmark.py --models $m --protocols external \
--seeds 0 1 2 --device cuda --epochs 30 --batch-size 256 \
--save-preds --resume --out ${OUT}/full_${m}.csv
done
}
run_phase3() { # the proposed models
python scripts/run_benchmark.py --models physset_phys --protocols external \
--seeds 0 1 2 --device cuda --epochs 30 --batch-size 256 \
--save-preds --resume --out ${OUT}/full_physset_phys.csv
python scripts/run_benchmark.py --models phcausal_phys --protocols external \
--device cuda --epochs 30 --batch-size 256 \
--save-preds --resume --out ${OUT}/full_phcausal_phys.csv
python scripts/run_benchmark.py --models probe_flat_rank --protocols external \
--device cuda --epochs 30 --batch-size 256 \
--save-preds --resume --out ${OUT}/full_probe_flat_rank.csv
python scripts/run_benchmark.py --models seqcausal --protocols external \
--device cuda --epochs 30 --batch-size 128 \
--save-preds --resume --out ${OUT}/full_seqcausal.csv
}
run_phase4() { # ablations of the final architecture: fold 0 of all four studies
# (physset_phys_nocond / _nomdaux / _nodual are registered and runnable but are
# not reported in the paper, so they are left out of the default matrix)
for m in physset_phys_norank physset_phys_nophys physset_phys_fp; do
python scripts/run_benchmark.py --models $m --protocols external \
--folds 0 --device cuda --epochs 30 --batch-size 256 \
--resume --out ${OUT}/abl_${m}.csv
done
# the identity-shortcut ladder (2 studies x fold 0)
for m in probe_flat probe_set probe_set_bias probe_physset_rank; do
python scripts/run_benchmark.py --models $m --protocols external \
--studies LM_2019 BL_2023 --folds 0 --device cuda --epochs 40 \
--batch-size 256 --resume --out ${OUT}/ladder_${m}.csv
done
}
run_phase5() { # secondary protocols
python scripts/run_benchmark.py --models xgboost mlp_fp --protocols amine --seeds 0 1 2 \
--device cpu --resume --out ${OUT}/benchmark_amine.csv
python scripts/run_benchmark.py --models physset_phys --protocols amine --seeds 0 1 2 \
--device cuda --epochs 30 --batch-size 256 --resume \
--out ${OUT}/benchmark_amine_proposed.csv
python scripts/run_benchmark.py --models xgboost mlp_fp --protocols cv5 \
--device cpu --resume --out ${OUT}/benchmark_cv5.csv
python scripts/run_benchmark.py --models physset_phys --protocols cv5 \
--device cuda --epochs 30 --batch-size 256 --resume \
--out ${OUT}/benchmark_cv5_proposed.csv
# study-balanced sampler ablation
python scripts/run_benchmark.py --models physset_phys_bal --protocols external \
--device cuda --epochs 30 --batch-size 256 --study-balance --resume \
--out ${OUT}/full_physset_bal.csv
}
run_phase6() { # ensembles, tables, figures (no GPU, < 1 min)
python scripts/ensemble.py --pred-dirs ${OUT}/predictions --out ${OUT}/ensemble.csv
python scripts/report.py --results ${OUT}
python scripts/make_figures.py --results ${OUT} --pred-dirs ${OUT}/predictions \
--outdir figures
python scripts/validate_ccpp.py
}
for p in $PHASES; do
echo "=== phase $p ==="
case $p in
1) run_phase1 ;;
2) run_phase2 ;;
3) run_phase3 ;;
4) run_phase4 ;;
5) run_phase5 ;;
6) run_phase6 ;;
*) echo "unknown phase $p" ;;
esac
done
echo "all done"