-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.sh
More file actions
65 lines (55 loc) · 2.09 KB
/
Copy pathscript.sh
File metadata and controls
65 lines (55 loc) · 2.09 KB
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
57
58
59
60
61
62
63
64
65
#!/bin/bash
#SBATCH --job-name=mem-no-mix # create a short name for your job
#SBATCH --nodes=1 # node count
#SBATCH --ntasks=16 # total number of tasks across all nodes
#SBATCH --cpus-per-task=8 # cpu-cores per task (>1 if multi-threaded tasks)
#SBATCH --mem-per-cpu=2G # memory per cpu-core (4G is default)
#SBATCH --time=0-05:00:00 # total run time limit (days-HH:MM:SS)
#SBATCH --mail-type=begin # send email when job begins
#SBATCH --mail-type=end # send email when job ends
#SBATCH --gres=gpu:1 # number of gpus per node
#SBATCH --mail-user=aalag@princeton.edu
#SBATCH --output=slurm-%j-%x.out
module purge
module load anaconda3/2022.5
conda activate audit
wandb offline
# epoch=50
epoch=200
# I=$1
I=0.0
# P=$1
P=-1
## Train the base + calibration model and run audit
experiment="MemGuard_noMixup"
# experiment="re-plateau$P"
dataset="Location"
# dataset="MNIST"
# Train the base model
python train_model.py --mode base --dataset $dataset --batch_size 64 --epoch $epoch --train_size 10000 --dropout $I --expt $experiment --plateau $P
# For MemGuard: train defense model
python train_model.py --mode defense --dataset $dataset --batch_size 64 --epoch 400 --train_size 10000 --expt $experiment
# For MemGuard: run defense script on the query folds
for fold in 1 2 3 4 5 6
do
srun python run_memguard.py --dataset $dataset --expt $experiment --def_epoch 400 --fold $fold &
done
wait
# train the calibration model
for k in 0 10 20 30 40 50
do
echo k $k
srun python train_model.py --mode cal --dataset $dataset --batch_size 64 --epoch $epoch --train_size 10000 --k $k --cal_data $dataset --dropout $I --expt $experiment --plateau $P &
done
wait
# evaluate the audit based on memguard flags
memguard=True
mixup=True
for k in 0 10 20 30 40 50
do
for fold in 1 2 3 4 5 6
do
echo k $k fold $fold
srun python run_audit.py --k $k --fold $fold --audit EMA --epoch $epoch --cal_data $dataset --dataset $dataset --cal_size 10000 --expt $experiment --dropout $I --memguard $memguard --randomize_memguard $mixup &
done
done