From 1ee8c240fe5d00e9b7be0e9d15edd3186973c867 Mon Sep 17 00:00:00 2001 From: YurenHao0426 Date: Mon, 10 Aug 2026 04:27:05 -0500 Subject: exp: compare equal upfront calibration budgets --- experiments/rain_ep_upfront_calibration_r5.sh | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 experiments/rain_ep_upfront_calibration_r5.sh (limited to 'experiments/rain_ep_upfront_calibration_r5.sh') 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 -- cgit v1.2.3