blob: 2a8fa6d91589eddb1fc6698b4570392e5f2241ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#!/usr/bin/env bash
# Depth-scaling sweep for sequential Feedback Alignment on the exact narrow
# residual architecture used by BP, DFA, and SDIL.
#
# Usage:
# bash experiments/baseline_depth_sweep.sh \
# <gpu> "<depths>" <width> "<seeds>" <epochs> <prefix>
set -eu
cd "$(dirname "$0")/.."
PY=/home/yurenh2/miniconda3/envs/ep_pascal/bin/python3
GPU="${1:?GPU index required}"
DEPTHS="${2:-30 60}"
WIDTH="${3:-64}"
SEEDS="${4:-0}"
EPOCHS="${5:-5}"
PREFIX="${6:-fa_scale}"
export CUDA_VISIBLE_DEVICES="$GPU"
export OMP_NUM_THREADS=2
mkdir -p results logs/baselines
for seed in $SEEDS; do
for depth in $DEPTHS; do
tag="${PREFIX}_cifar10_fa_w${WIDTH}_d${depth}_s${seed}"
result="results/${tag}.json"
log="logs/baselines/${tag}.log"
if [[ -f "$result" ]]; then
echo "skip $tag (result exists)"
continue
fi
echo ">>> $tag $(date --iso-8601=seconds) gpu=$GPU"
"$PY" experiments/baseline_run.py \
--method fa --dataset cifar10 --depth "$depth" --width "$WIDTH" \
--act tanh --residual 1 --epochs "$EPOCHS" --seed "$seed" \
--eta 0.05 --batch_size 128 --tag "$tag" --outdir results \
> "$log" 2>&1
grep -h DONE "$log"
done
done
|