#!/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="${RAIN_EP_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 local predictor_kind=$5 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 \ --predictor-kind "$predictor_kind" \ --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" nlms & gpu=$((gpu + 1)) run_cell "$gpu" "$probes" innovation "probes_${probes}_sdil" \ "${SDIL_PREDICTOR_KIND:-nlms}" & 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