summaryrefslogtreecommitdiff
path: root/experiments/traffic_validation_sweep.sh
diff options
context:
space:
mode:
authorYurenHao0426 <Blackhao0426@gmail.com>2026-07-22 01:39:56 -0500
committerYurenHao0426 <Blackhao0426@gmail.com>2026-07-22 01:39:56 -0500
commitb4764d2973b49e57f2322b98c7a4dac55cad5e0d (patch)
treee3718fd80be04f7c283eab039229bdb6eb98915d /experiments/traffic_validation_sweep.sh
parent98dddcfabb39c13f652b3aa44f0926ee04428c06 (diff)
experiments: add validation-only apical traffic sweep
Diffstat (limited to 'experiments/traffic_validation_sweep.sh')
-rwxr-xr-xexperiments/traffic_validation_sweep.sh74
1 files changed, 74 insertions, 0 deletions
diff --git a/experiments/traffic_validation_sweep.sh b/experiments/traffic_validation_sweep.sh
new file mode 100755
index 0000000..9d27e25
--- /dev/null
+++ b/experiments/traffic_validation_sweep.sh
@@ -0,0 +1,74 @@
+#!/usr/bin/env bash
+# Development-only validation sweep for endogenous non-teaching apical traffic.
+# No test-set metric is emitted. Freeze a protocol before creating test results.
+#
+# Usage:
+# traffic_validation_sweep.sh <gpu> [dataset] [families] [scales] [signals] [seeds]
+# Example:
+# traffic_validation_sweep.sh 5 mnist "soma topdown" "0 0.2 0.5" \
+# "raw matched residual taskfit" "0 1"
+set -eu
+
+cd "$(dirname "$0")/.."
+GPU="${1:?GPU index required}"
+DATASET="${2:-mnist}"
+FAMILIES="${3:-soma topdown}"
+SCALES="${4:-0 0.2 0.5}"
+SIGNALS="${5:-raw matched residual taskfit}"
+SEEDS="${6:-0}"
+PYTHON="${PYTHON:-/home/yurenh2/miniconda3/envs/ep_pascal/bin/python3}"
+
+for seed in $SEEDS; do
+ for family in $FAMILIES; do
+ for scale in $SCALES; do
+ # The zero-traffic condition is family-independent.
+ if [ "$scale" = "0" ] && [ "$family" != "soma" ]; then
+ continue
+ fi
+ scale_tag="${scale//./p}"
+ for signal in $SIGNALS; do
+ use_residual=1
+ raw_control=none
+ p_neutral=1
+ case "$signal" in
+ raw)
+ use_residual=0
+ ;;
+ matched)
+ use_residual=0
+ raw_control=match_innovation_norm
+ ;;
+ residual)
+ ;;
+ taskfit)
+ p_neutral=0
+ ;;
+ *)
+ echo "unknown signal control: $signal" >&2
+ exit 2
+ ;;
+ esac
+
+ tag="traffic_dev_v1_${DATASET}_${family}_rho${scale_tag}_${signal}_d3_s${seed}"
+ out="results/${tag}.json"
+ if [ -s "$out" ]; then
+ echo "[$tag] exists; skipping"
+ continue
+ fi
+ CUDA_VISIBLE_DEVICES="$GPU" "$PYTHON" experiments/run.py \
+ --mode sdil --dataset "$DATASET" --device cuda \
+ --depth 3 --width 256 --residual 1 --act tanh \
+ --epochs 15 --batch_size 128 --eta 0.05 --momentum 0.9 \
+ --eta_A 0.02 --eta_P 0.002 \
+ --pert_sigma 0.01 --pert_every 4 --pert_ndirs 16 \
+ --pert_mode simultaneous \
+ --traffic_mode "$family" --nuis_rho "$scale" \
+ --use_residual "$use_residual" --raw_scale_control "$raw_control" \
+ --learn_A 1 --learn_P 1 --p_neutral "$p_neutral" \
+ --p_warmup_steps 200 --p_warmup_eta 0.05 \
+ --val_examples 5000 --split_seed 2027 --eval_split validation \
+ --seed "$seed" --log_every 100 --tag "$tag"
+ done
+ done
+ done
+done