From a0696a3d72cc5bf69876e1716b74f7e1ac525dd0 Mon Sep 17 00:00:00 2001 From: YurenHao0426 Date: Wed, 22 Jul 2026 01:48:05 -0500 Subject: experiments: add useful-depth validation screen --- experiments/depth_task_validation_sweep.sh | 74 ++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100755 experiments/depth_task_validation_sweep.sh (limited to 'experiments/depth_task_validation_sweep.sh') diff --git a/experiments/depth_task_validation_sweep.sh b/experiments/depth_task_validation_sweep.sh new file mode 100755 index 0000000..5105069 --- /dev/null +++ b/experiments/depth_task_validation_sweep.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +# Validation-only screening for tasks on which additional depth is useful to BP. +# The test generator is not evaluated. Only tasks passing the BP depth-gain gate +# should advance to local-learning and lesion experiments. +# +# Usage: +# depth_task_validation_sweep.sh [depths] [modes] [width] [model_seeds] [task_seeds] +set -eu + +cd "$(dirname "$0")/.." +GPU="${1:?GPU index required}" +DATASET="${2:?dataset required: teacher, hierarchical, or tentmap}" +DEPTHS="${3:-1 2 4 6 8 12}" +MODES="${4:-bp}" +WIDTH_OVERRIDE="${5:-}" +MODEL_SEEDS="${6:-0}" +TASK_SEEDS="${7:-0}" +PYTHON="${PYTHON:-/home/yurenh2/miniconda3/envs/ep_pascal/bin/python3}" + +case "$DATASET" in + teacher) + WIDTH="${WIDTH_OVERRIDE:-64}" + ACT=tanh + RESIDUAL=1 + EPOCHS=25 + ETA=0.03 + TASK_ARGS="--task_n_in 128 --task_classes 10 --teacher_depth 8 --teacher_width 64 --teacher_residual 1" + ;; + hierarchical) + WIDTH="${WIDTH_OVERRIDE:-64}" + ACT=tanh + RESIDUAL=1 + EPOCHS=25 + ETA=0.03 + TASK_ARGS="--task_levels 6 --task_classes 10" + ;; + tentmap) + WIDTH="${WIDTH_OVERRIDE:-16}" + ACT=relu + RESIDUAL=0 + EPOCHS=40 + ETA=0.02 + TASK_ARGS="--task_levels 7 --task_n_in 4" + ;; + *) + echo "unknown depth task: $DATASET" >&2 + exit 2 + ;; +esac + +for task_seed in $TASK_SEEDS; do + for model_seed in $MODEL_SEEDS; do + for mode in $MODES; do + for depth in $DEPTHS; do + tag="depthtask_dev_v1_${DATASET}_${mode}_w${WIDTH}_d${depth}_t${task_seed}_s${model_seed}" + out="results/${tag}.json" + if [ -s "$out" ]; then + echo "[$tag] exists; skipping" + continue + fi + CUDA_VISIBLE_DEVICES="$GPU" "$PYTHON" experiments/run.py \ + --mode "$mode" --dataset "$DATASET" --device cuda \ + --depth "$depth" --width "$WIDTH" --act "$ACT" --residual "$RESIDUAL" \ + --epochs "$EPOCHS" --batch_size 128 --eta "$ETA" --momentum 0.9 \ + --eta_A 0.02 --eta_P 0.002 \ + --pert_sigma 0.01 --pert_every 4 --pert_ndirs 16 --pert_mode simultaneous \ + --task_train_examples 50000 --task_test_examples 10000 \ + --task_seed "$task_seed" $TASK_ARGS \ + --val_examples 5000 --split_seed 2027 --eval_split validation \ + --seed "$model_seed" --log_every 200 --tag "$tag" + done + done + done +done -- cgit v1.2.3