#!/bin/bash # Meta-train an in-context model on one GPU, then classify GamGam in context # with its best checkpoint for each number of labelled events: # sbatch -A --export=ALL,CONFIG=configs/delphes_tabicl.yaml,EVAL_CONFIG=configs/gamgam_tabicl.yaml \ # scripts/meta_train.sh [key=value ...] # CONFIG is configs/delphes_{pfn,tabpfn,tabicl}.yaml and EVAL_CONFIG the # matching configs/gamgam_*.yaml (none: meta-training only). key=value # overrides apply to both (e.g. task.prior_classes=[1,6,7,8,9,10,11], which # leaves the GamGam processes out; model.lora_rank=0). Prepare the Delphes # and GamGam event caches first. #SBATCH -N 1 #SBATCH -C gpu #SBATCH -q shared #SBATCH -G 1 #SBATCH -c 32 #SBATCH -t 12:00:00 #SBATCH -o logs/meta_train_%j.out set -euo pipefail cd "${SLURM_SUBMIT_DIR:-$(pwd)}" CONFIG="${CONFIG:-configs/delphes_pfn.yaml}" name="$(basename "${CONFIG}" .yaml)" RUN="${RUN:-outputs/${name}}" export OMP_NUM_THREADS="${OMP_NUM_THREADS:-8}" export UV_CACHE_DIR="${UV_CACHE_DIR:-${SCRATCH:-${HOME}/.cache}/uv}" export HF_HOME="${HF_HOME:-${SCRATCH:-${HOME}/.cache}/huggingface}" export TABPFN_MODEL_CACHE_DIR="${TABPFN_MODEL_CACHE_DIR:-${SCRATCH:-${HOME}/.cache}/tabpfn}" mkdir -p logs uv run --all-extras gnn4colliders train "${CONFIG}" run_dir="${RUN}" "$@" if [[ -n "${EVAL_CONFIG:-}" ]]; then read -r -a events <<< "${EVENTS:-100 1000 10000 50000}" evaluated="$(basename "${EVAL_CONFIG}" .yaml)_from_${name}" uv run --all-extras python scripts/label_efficiency.py "${EVAL_CONFIG}" \ --events "${events[@]}" --out "${OUT:-outputs/label_efficiency}" \ --override name="${evaluated}" checkpoint="${RUN}/best.pt" "$@" fi