#!/bin/bash # Run full clean sparsity analysis — each method+seed in independent Python process # GPU 1 only (CUDA_VISIBLE_DEVICES=1) set -e cd /home/yurenh2/fa export CUDA_VISIBLE_DEVICES=1 mkdir -p results/confirmatory/clean_sparsity CIFAR_SEEDS="42 123 456 789 1024 2048" CIFAR_METHODS="bp dfa state_bridge credit_bridge" SYNTH_SEEDS="42 123 456 789 1024 2048" SYNTH_METHODS="bp dfa state_bridge credit_bridge" SYNTH_ALPHAS="0.0 0.5 1.0" SYNTH_DEPTHS="4 8" echo "=== CIFAR SPARSITY ($(echo $CIFAR_SEEDS | wc -w) seeds × $(echo $CIFAR_METHODS | wc -w) methods) ===" count=0 total=$(($(echo $CIFAR_SEEDS | wc -w) * $(echo $CIFAR_METHODS | wc -w))) for method in $CIFAR_METHODS; do for seed in $CIFAR_SEEDS; do count=$((count + 1)) echo "[$count/$total] CIFAR $method s=$seed" python experiments/clean_sparsity_full.py --dataset cifar --method $method --seed $seed --gpu 0 --output_dir results/confirmatory/clean_sparsity done done echo "=== CIFAR DONE ===" echo "" echo "=== SYNTHETIC SPARSITY ===" count=0 total=$(($(echo $SYNTH_SEEDS | wc -w) * $(echo $SYNTH_METHODS | wc -w) * $(echo $SYNTH_ALPHAS | wc -w) * $(echo $SYNTH_DEPTHS | wc -w))) for alpha in $SYNTH_ALPHAS; do for depth in $SYNTH_DEPTHS; do for method in $SYNTH_METHODS; do for seed in $SYNTH_SEEDS; do count=$((count + 1)) ckpt="results/confirmatory/checkpoints_A1/a${alpha}_L${depth}_${method}_s${seed}.pt" if [ ! -f "$ckpt" ]; then echo "[$count/$total] SKIP $ckpt" continue fi echo "[$count/$total] synth a=$alpha L=$depth $method s=$seed" python experiments/clean_sparsity_full.py --dataset synth --method $method --seed $seed --alpha $alpha --depth $depth --gpu 0 --output_dir results/confirmatory/clean_sparsity done done done done echo "=== SYNTHETIC DONE ===" echo "=== ALL CLEAN SPARSITY DONE ==="