summaryrefslogtreecommitdiff
path: root/scripts/run_adaptive_exp.sbatch
blob: e72fe34f159f0c4d0ed7443db5cf6018f1eb0fc4 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#SBATCH --job-name=snn_adapt_exp
#SBATCH --account=bfqt-delta-gpu
#SBATCH --partition=gpuA40x4
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --gpus-per-node=1
#SBATCH --mem=64G
#SBATCH --time=12:00:00
#SBATCH --output=runs/slurm_logs/%j_adaptive_exp.out
#SBATCH --error=runs/slurm_logs/%j_adaptive_exp.err

# ============================================================
# Experiment: Adaptive Exponential Regularization
# ============================================================
# Penalty = (exp(excess) - 1) * excess where excess = max(0, λ - threshold)
# This gives:
#   - Zero penalty when λ < threshold
#   - Exponential growth for λ > threshold (very gentle near threshold, explosive when chaotic)
# ============================================================

set -e

PROJECT_DIR="/projects/bfqt/users/yurenh2/ml-projects/snn-training"
cd "$PROJECT_DIR"

mkdir -p runs/slurm_logs data runs/adaptive_exp

echo "============================================================"
echo "ADAPTIVE EXPONENTIAL Regularization"
echo "Job ID: $SLURM_JOB_ID | Node: $SLURM_NODELIST"
echo "Start: $(date)"
echo "============================================================"
nvidia-smi --query-gpu=name,memory.total --format=csv,noheader
echo "============================================================"

python files/experiments/depth_scaling_benchmark.py \
    --dataset cifar100 \
    --depths 4 8 12 16 \
    --T 4 \
    --epochs 150 \
    --batch_size 128 \
    --lr 0.001 \
    --lambda_reg 0.3 \
    --lambda_target -0.1 \
    --reg_type adaptive_exp \
    --lyap_threshold 2.0 \
    --warmup_epochs 10 \
    --data_dir ./data \
    --out_dir runs/adaptive_exp \
    --device cuda

echo "============================================================"
echo "Finished: $(date)"
echo "============================================================"