summaryrefslogtreecommitdiff
path: root/experiments
diff options
context:
space:
mode:
authorYurenHao0426 <Blackhao0426@gmail.com>2026-08-10 04:27:05 -0500
committerYurenHao0426 <Blackhao0426@gmail.com>2026-08-10 04:27:05 -0500
commit1ee8c240fe5d00e9b7be0e9d15edd3186973c867 (patch)
treea14a58221d97f274c6e4ccfc4faf5505b4a397e2 /experiments
parent407aa32c495a1c2504b315675e91cbfda7bc2ac3 (diff)
exp: compare equal upfront calibration budgets
Diffstat (limited to 'experiments')
-rwxr-xr-xexperiments/rain_ep_upfront_calibration_r5.sh59
1 files changed, 59 insertions, 0 deletions
diff --git a/experiments/rain_ep_upfront_calibration_r5.sh b/experiments/rain_ep_upfront_calibration_r5.sh
new file mode 100755
index 0000000..d759111
--- /dev/null
+++ b/experiments/rain_ep_upfront_calibration_r5.sh
@@ -0,0 +1,59 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+ROOT=/home/yurenh2/sdil
+AUTHOR=/scratch/yurenh2/energy-based-learning
+PYTHON=/scratch/yurenh2/venvs/burstccn/bin/python
+PROFILE="$ROOT/results/physical_bias/p0_state_dependence.json"
+OUT="$ROOT/results/ep_bias/centered_r5_upfront"
+mkdir -p "$OUT"
+cd "$AUTHOR"
+
+run_cell() {
+ local gpu=$1
+ local probes=$2
+ local mode=$3
+ local tag=$4
+ CUBLAS_WORKSPACE_CONFIG=:4096:8 CUDA_VISIBLE_DEVICES="$gpu" "$PYTHON" \
+ "$ROOT/experiments/rain_ep_bias_train.py" \
+ --author-root "$AUTHOR" --device cuda \
+ --adapter dillavou --network-protocol comparative32 \
+ --beta-policy centered --beta-value 0.25 \
+ --mode "$mode" --bias-ratio 1 \
+ --dillavou-profile-json "$PROFILE" --predictor-rate 1 \
+ --dillavou-calibration-steps "$probes" --neutral-cadence 0 \
+ --epochs 1 --schedule-epochs 100 \
+ --train-limit 10000 --test-limit 2000 --batch-size 128 \
+ --training-iterations 15 --inference-iterations 60 \
+ --evaluation-split train_holdout --data-seed 6200 \
+ --seed 1988 --beta-seed 7100 --deterministic \
+ --output "$OUT/$tag.json" > "$OUT/$tag.log" 2>&1
+}
+
+probe_budgets=(2 4 8 16)
+gpu=0
+for probes in "${probe_budgets[@]}"; do
+ run_cell "$gpu" "$probes" constant "probes_${probes}_intercept" &
+ gpu=$((gpu + 1))
+ run_cell "$gpu" "$probes" innovation "probes_${probes}_sdil" &
+ gpu=$((gpu + 1))
+done
+wait
+
+"$PYTHON" - "$OUT" <<'PY'
+import json
+from pathlib import Path
+import sys
+
+root = Path(sys.argv[1])
+by_budget = {}
+for path in sorted(root.glob("probes_*.json")):
+ _, probes, method = path.stem.split("_", 2)
+ report = json.loads(path.read_text())
+ by_budget.setdefault(probes, {})[method] = report["final"]["test_accuracy"]
+for probes, values in by_budget.items():
+ values["sdil_minus_intercept"] = values["sdil"] - values["intercept"]
+summary = {"by_upfront_probe_budget": by_budget}
+(root / "summary.json").write_text(json.dumps(summary, indent=2) + "\n")
+print(json.dumps(summary, indent=2))
+PY