-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtrain.sh
executable file
·42 lines (33 loc) · 1.66 KB
/
train.sh
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
#!/bin/bash
#SBATCH --gres=gpu:v100l:1 # Request GPU "generic resources"
#SBATCH --cpus-per-task=6 # Cores proportional to GPUs: 6 on Cedar, 16 on Graham.
#SBATCH --mem=32000M # Memory proportional to GPUs: 32000 Cedar, 64000 Graham.
#SBATCH --time=02:00:00
#SBATCH --output=%N-%j.out
U_SIZE=$1
V_SIZE=$2
GRAPH_FAMILY=$4
PROBLEM="e-obm"
FAMILY_PARAMETER=$3
TRAIN_SIZE=10000
VAL_SIZE=1000
EMBEDDING_SIZE=30
MAX_WEIGHT=100
WEIGHT_DIST=$5
MEAN=$6
VARIANCE=$7
a=3
DATASET="$PROBLEM"_"$GRAPH_FAMILY"_"$U_SIZE"by"$V_SIZE"_"p=$FAMILY_PARAMETER"_"$WEIGHT_DIST"_"m=$MEAN"_"v=$VARIANCE"_"a=$a"
MODEL=$8
module load python/3.7
module load scipy-stack
virtualenv --no-download $SLURM_TMPDIR/env
source $SLURM_TMPDIR/env/bin/activate
pip install --no-index --upgrade pip
pip install --no-index --no-cache-dir --upgrade --force-reinstall -r requirements.txt
# Prepare data
tar xf ~/projects/def-khalile2/alomrani/$DATASET.tar -C $SLURM_TMPDIR/
mkdir $SLURM_TMPDIR/logs_$DATASET
python run.py --seed 89759 --problem $PROBLEM --encoder mpnn --batch_size 200 --eval_batch_size 200 --embedding_dim $EMBEDDING_SIZE --n_heads 1 --u_size $U_SIZE --v_size $V_SIZE --n_epochs 120 --train_dataset $SLURM_TMPDIR/$DATASET/train --val_dataset $SLURM_TMPDIR/$DATASET/val --dataset_size $TRAIN_SIZE --val_size $VAL_SIZE --checkpoint_epochs 10 --baseline exponential --exp_beta ${11} --lr_model $9 --lr_decay ${10} --ent_rate ${12} --output_dir $SLURM_TMPDIR/output_$DATASET --log_dir $SLURM_TMPDIR/logs_$DATASET --max_grad_norm 1.0 --n_encode_layers 3 --model $MODEL
cp -r $SLURM_TMPDIR/output_$DATASET ~/projects/def-khalile2/alomrani/
cp -r $SLURM_TMPDIR/logs_$DATASET ~/projects/def-khalile2/alomrani/