#!/usr/bin/env bash # v28 training — Matcher-free: L_mat disabled (--no-mat). # # Goal: Validate that L_sens + L_deg + L_ortho + L_spread are sufficient # for sensor-invariant quality ordering without any external matcher teacher. # # Key change from v26: # --no-mat : skip MDGT entirely (no loading, no emb_cache, no prototypes) # l_mat = 0.0 for all steps/epochs; stage scheduler still runs # normally for beta/gamma (sensor + degradation weights unaffected) # --spread-weight 4.0 : slightly stronger spread to compensate for lost L_mat anchor # NOTE: do NOT add --fixed-alpha 0.0 — that overrides beta/gamma too (-1.0 default), # # Paper argument if this works: # "SIFQ quality emerges from degradation ordering and sensor consistency alone, # without any external matcher supervision. This scorer-free quality generalises # across matchers (Track 1 ERC) with no matcher-specific bias." # # Expected dynamics: # S1 (ep 0-9): q_std grows from L_deg + L_spread (no L_mat anchor — may be slower) # S2+ (ep 20+): L_sens stabilises sensor gap; L_deg maintains ordinal grounding # Risk: without L_mat, collapse is possible if L_deg/L_spread insufficient. # Watch q_std and l_spread in logs. If q_std < 5 at ep15, training failed. set -euo pipefail REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" export PATH="/home/aiserver/miniconda3/bin:$PATH" VERSION="v28" SAVE_DIR="${REPO_ROOT}/sifq/checkpoints/${VERSION}" LOG_FILE="${REPO_ROOT}/sifq/logs/train_${VERSION}.log" EVAL_SCRIPT="${REPO_ROOT}/sifq/scripts/run_eval_${VERSION}.sh" mkdir -p "${REPO_ROOT}/sifq/logs" python "${REPO_ROOT}/sifq/scripts/train_sifq.py" \ --root-302a "${REPO_ROOT}/dataset/302a/images/challengers" \ --root-302b "${REPO_ROOT}/dataset/302b/images/baseline" \ --root-302d "${REPO_ROOT}/dataset/nist_302d/images/auxiliary" \ --root-fvc2002 "${REPO_ROOT}/dataset/FVC_Dataset/FVC2002" \ --root-fvc2004 "${REPO_ROOT}/dataset/FVC_Dataset/FVC2004" \ --root-polyu "${REPO_ROOT}/dataset/PolyU" \ --exclude-sensor "R_1000_slap,R_500_slap,S_500_slap" \ --no-mat \ --epochs 60 \ --batch-size 96 \ --image-size 224 \ --lr 1e-4 \ --spread-mode uniform \ --spread-weight 4.0 \ --concept-deg-gamma 2.0 \ --sd302-concept-weight 0.0 \ --deg-every-n-steps 2 \ --k-cross 0 \ --max-train-samples -1 \ --num-workers 8 \ --gpus 0 \ --save-dir "${SAVE_DIR}" \ 2>&1 | tee "${LOG_FILE}" echo "[auto-eval] Training done. Starting eval ${VERSION}..." bash "${EVAL_SCRIPT}" >> "${LOG_FILE}" 2>&1