summaryrefslogtreecommitdiff
path: root/reproduce/run_all.sh
diff options
context:
space:
mode:
Diffstat (limited to 'reproduce/run_all.sh')
-rwxr-xr-xreproduce/run_all.sh85
1 files changed, 85 insertions, 0 deletions
diff --git a/reproduce/run_all.sh b/reproduce/run_all.sh
new file mode 100755
index 0000000..35c3587
--- /dev/null
+++ b/reproduce/run_all.sh
@@ -0,0 +1,85 @@
+#!/bin/bash
+# Full reproduction of all paper results.
+# Usage: bash reproduce/run_all.sh --gpu 0
+# Estimated time: ~12 hours on a single A100/A6000.
+
+GPU=${1:-0}
+export CUDA_VISIBLE_DEVICES=$GPU
+
+echo "============================================================"
+echo "FA Evaluation Protocol — Full Reproduction"
+echo "GPU: $GPU"
+echo "Start: $(date)"
+echo "============================================================"
+
+cd "$(dirname "$0")/.."
+
+# ─── Section 2: Primary audit (ResMLP d=256 L=4, 100ep) ─────────────────
+
+echo ""
+echo "=== Section 2: Primary audit (BP/FA/DFA, 3 seeds, 100ep) ==="
+python reproduce/train_methods.py --arch resmlp --methods bp fa dfa \
+ --seeds 42 123 456 --epochs 100 --gpu 0 --output_dir results/sec2_primary_audit
+
+echo ""
+echo "=== Section 2: Frozen baseline ==="
+python reproduce/frozen_baseline.py --arch resmlp --seeds 42 123 456 \
+ --epochs 100 --gpu 0 --output_dir results/sec2_frozen
+
+# ─── Section 4.1: Cross-architecture (ViT, ResNet) ───────────────────────
+
+echo ""
+echo "=== Section 4.1: ViT-Mini (BP/FA/DFA, 3 seeds, 60ep) ==="
+python reproduce/train_methods.py --arch vit --methods bp fa dfa \
+ --seeds 42 123 456 --epochs 60 --gpu 0 --output_dir results/sec4_vit
+
+echo ""
+echo "=== Section 4.1: ViT-Mini frozen baseline ==="
+python reproduce/frozen_baseline.py --arch vit --seeds 42 123 456 \
+ --epochs 60 --gpu 0 --output_dir results/sec4_vit_frozen
+
+echo ""
+echo "=== Section 4.1: SmallResNet (BP/FA/DFA, 3 seeds, 100ep) ==="
+python reproduce/train_methods.py --arch resnet --methods bp fa dfa \
+ --seeds 42 123 456 --epochs 100 --gpu 0 --output_dir results/sec4_resnet
+
+echo ""
+echo "=== Section 4.1: SmallResNet frozen baseline ==="
+python reproduce/frozen_baseline.py --arch resnet --seeds 42 123 456 \
+ --epochs 100 --gpu 0 --output_dir results/sec4_resnet_frozen
+
+# ─── Section 4.2: Penalty intervention ───────────────────────────────────
+
+echo ""
+echo "=== Section 4.2: DFA penalty sweep (lambda=0, 1e-4, 1e-2, 30ep) ==="
+python reproduce/penalty_sweep.py --seeds 42 123 456 --epochs 30 --gpu 0 \
+ --output_dir results/sec4_penalty
+
+# ─── Section 5.2: Representative setting (d=512 L=2) ────────────────────
+
+echo ""
+echo "=== Section 5.2: d=512 L=2 (BP/FA/DFA, 3 seeds, 100ep) ==="
+python reproduce/train_methods.py --arch resmlp_d512_L2 --methods bp fa dfa \
+ --seeds 1 2 5 --epochs 100 --gpu 0 --output_dir results/sec5_d512_L2
+
+echo ""
+echo "=== Section 5.2: d=512 L=2 frozen baseline ==="
+python reproduce/frozen_baseline.py --arch resmlp_d512_L2 --seeds 1 2 5 \
+ --epochs 100 --gpu 0 --output_dir results/sec5_d512_L2_frozen
+
+# ─── Appendix: CIFAR-100 ────────────────────────────────────────────────
+
+echo ""
+echo "=== Appendix: CIFAR-100 (BP/FA/DFA, 3 seeds, 100ep) ==="
+python reproduce/train_methods.py --arch resmlp --dataset cifar100 --methods bp fa dfa \
+ --seeds 42 123 456 --epochs 100 --gpu 0 --output_dir results/app_cifar100
+
+echo ""
+echo "=== Appendix: CIFAR-100 frozen baseline ==="
+python reproduce/frozen_baseline.py --arch resmlp --dataset cifar100 --seeds 42 123 456 \
+ --epochs 100 --gpu 0 --output_dir results/app_cifar100_frozen
+
+echo ""
+echo "============================================================"
+echo "Full reproduction done: $(date)"
+echo "============================================================"