#!/usr/bin/env bash # Run all progress + classification probe experiments (Himacon). # Does NOT overwrite classification LR dirs when running MLP (separate _mlp paths). # Logs: logs/all_experiments_YYYYMMDD_HHMMSS.log set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$ROOT" # Prefer env_probe.sh / pi05 if [[ -f /data/mani/miniconda3/env_probe.sh ]]; then # shellcheck disable=SC1091 source /data/mani/miniconda3/env_probe.sh fi export PATH="/data/mani/miniconda3/envs/pi05/bin:${PATH:-}" PY="${PROBE_PYTHON:-$(command -v python)}" LABEL=/share/robotwin2.0-hard-cross-embodiment VIDEO=/share/robotwin2.0-hard ANN="$ROOT/outputs/classification_probe" OUT_CLS="$ROOT/outputs/classification_probe" TASK_CLS=blocks_ranking_rgb SPLITS="${N_SPLITS:-5}" SEED="${SEED:-42}" EP="${MAX_EPISODES:-100}" mkdir -p logs LOG="logs/all_experiments_$(date +%Y%m%d_%H%M%S).log" echo "Logging to $ROOT/$LOG (also use outer redirect when launching)" echo "============================================================" echo "[$(date)] ALL EXPERIMENTS START" echo "python=$PY" echo "log=$LOG" echo "============================================================" # --------------------------------------------------------------------------- # A) Progress probe (regression) # --------------------------------------------------------------------------- echo "" echo "######## A1 progress: scan-dataset ########" "$PY" -u progress_probe.py scan-dataset \ --label-root "$LABEL" --video-root "$VIDEO" \ --output-json outputs/dataset_manifest.json echo "" echo "######## A2 progress: within-robot (new tasks + tables/viz) ########" "$PY" -u run_within_robot_new_tasks.py echo "" echo "######## A3 progress: cross-robot (all tasks) ########" "$PY" -u run_all_cross_robot.py # --------------------------------------------------------------------------- # B) Classification probe — LogisticRegression (legacy paths) # --------------------------------------------------------------------------- echo "" echo "######## B classification LR: check-distribution ########" "$PY" -u classification_probe.py check-distribution \ --task "$TASK_CLS" --annotation-root "$ANN" --output-dir "$OUT_CLS/summary" for DEMO in demo_clean_100_arx demo_clean_100_franka demo_clean_100_ur5; do for LK in full_label womae_label; do echo "" echo "######## B within LR $DEMO $LK ########" "$PY" -u classification_probe.py fit-cv \ --task "$TASK_CLS" --demo "$DEMO" --label-kind "$LK" --probe lr \ --label-root "$LABEL" --video-root "$VIDEO" --annotation-root "$ANN" \ --output-dir "$OUT_CLS/within_robot/$TASK_CLS/$DEMO/${LK}_val0_960" \ --n-splits "$SPLITS" --seed "$SEED" --max-episodes "$EP" "$PY" -u classification_probe.py fit-time-baseline \ --task "$TASK_CLS" --demo "$DEMO" --label-kind "$LK" \ --label-root "$LABEL" --video-root "$VIDEO" --annotation-root "$ANN" \ --output-dir "$OUT_CLS/baselines/time_only/$TASK_CLS/$DEMO/${LK}_val0" \ --n-splits "$SPLITS" --seed "$SEED" --max-episodes "$EP" done done echo "" echo "######## B cross LR ########" "$PY" -u classification_probe.py fit-cross-robot \ --task "$TASK_CLS" --label-root "$LABEL" --video-root "$VIDEO" --annotation-root "$ANN" \ --output-dir "$OUT_CLS/cross_robot/$TASK_CLS" --probe lr --seed "$SEED" \ --label-kinds full_label womae_label --max-episodes "$EP" echo "" echo "######## B summarize LR ########" "$PY" -u classification_probe.py summarize \ --task "$TASK_CLS" --label-root "$LABEL" --video-root "$VIDEO" \ --annotation-root "$ANN" --results-root "$OUT_CLS" \ --probe lr --max-episodes "$EP" --seed "$SEED" # --------------------------------------------------------------------------- # C) Classification probe — MLP (separate dirs, no overwrite) # --------------------------------------------------------------------------- for DEMO in demo_clean_100_arx demo_clean_100_franka demo_clean_100_ur5; do for LK in full_label womae_label; do echo "" echo "######## C within MLP $DEMO $LK ########" "$PY" -u classification_probe.py fit-cv \ --task "$TASK_CLS" --demo "$DEMO" --label-kind "$LK" --probe mlp \ --label-root "$LABEL" --video-root "$VIDEO" --annotation-root "$ANN" \ --output-dir "$OUT_CLS/within_robot/$TASK_CLS/$DEMO/${LK}_val0_960_mlp" \ --n-splits "$SPLITS" --seed "$SEED" --max-episodes "$EP" done done echo "" echo "######## C cross MLP ########" "$PY" -u classification_probe.py fit-cross-robot \ --task "$TASK_CLS" --label-root "$LABEL" --video-root "$VIDEO" --annotation-root "$ANN" \ --output-dir "$OUT_CLS/cross_robot_mlp/$TASK_CLS" --probe mlp --seed "$SEED" \ --label-kinds full_label womae_label --max-episodes "$EP" echo "" echo "######## C summarize MLP ########" "$PY" -u classification_probe.py summarize \ --task "$TASK_CLS" --label-root "$LABEL" --video-root "$VIDEO" \ --annotation-root "$ANN" --results-root "$OUT_CLS" \ --probe mlp --max-episodes "$EP" --seed "$SEED" echo "" echo "============================================================" echo "[$(date)] ALL EXPERIMENTS DONE" echo "log=$LOG" echo "============================================================"