#!/usr/bin/env bash
# Augmentation ablation on the best model (vlaai_ws, mat): base augmentation (results/vlaai_ws__mat_aug.json)
# + one extra group each (config aug_variants), then all together. Results: results/vlaai_ws__mat_aug_<variant>.json
cd "$(dirname "$0")/.."
PY=../../.venv/bin/python
QLOG=logs/queue_augv.log
echo "$(date '+%F %T') queue augv started" | tee -a "$QLOG"
for v in cluster balance renorm warplag all; do
  exp="vlaai_ws__mat_aug_${v}"
  [[ -f results/$exp.json ]] && continue
  echo "$(date '+%F %T') START $exp" | tee -a "$QLOG"
  if $PY run_experiment.py --decoder vlaai_ws --prep mat --tag _aug_${v} --aug-variant $v < /dev/null >> logs/$exp.stdout 2>&1; then
    rm -f results/$exp.FAILED
    echo "$(date '+%F %T') DONE  $exp: $(grep 'MEAN over' logs/$exp.log | tail -1 | cut -d' ' -f3-)" | tee -a "$QLOG"
  else
    touch results/$exp.FAILED; echo "$(date '+%F %T') FAILED $exp" | tee -a "$QLOG"
  fi
  $PY summarize.py > /dev/null 2>&1 || true
done
echo "$(date '+%F %T') queue augv finished" | tee -a "$QLOG"
