File size: 5,211 Bytes
6b11150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/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 "============================================================"