summaryrefslogtreecommitdiff
path: root/experiments/ep_original_sweep.sh
blob: 9bb594703e5c0681eb69f7a0bd28109afdeca4a5 (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
#!/usr/bin/env bash
# Scellier & Bengio (2017) one-hidden-layer MNIST protocol, adapted only to
# evaluate on the standard 10k test split. Persistent particles use the fixed
# first 50k training examples, matching the author's training-set size.
# Usage: ep_original_sweep.sh <gpu> "<seeds>" [prefix]
set -eu

cd "$(dirname "$0")/.."
PY=/home/yurenh2/miniconda3/envs/ep_pascal/bin/python3
GPU="${1:?GPU index required}"
SEEDS="${2:-0}"
PREFIX="${3:-ep_original_v2}"

export CUDA_VISIBLE_DEVICES="$GPU"
export OMP_NUM_THREADS=2
mkdir -p results logs/baselines

for seed in $SEEDS; do
  tag="${PREFIX}_mnist_ep_w500_d1_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 ep --dataset mnist --depth 1 --width 500 --epochs 25 \
    --batch_size 20 --train_examples 50000 --ep_persistent 1 \
    --seed "$seed" --tag "$tag" --outdir results > "$log" 2>&1
  grep -h DONE "$log"
done