forked from mllam/neural-lam
-
Notifications
You must be signed in to change notification settings - Fork 1
/
slurm_eval.sh
44 lines (40 loc) · 1.51 KB
/
slurm_eval.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
43
44
#!/bin/bash -l
#SBATCH --job-name=NeurWPe
#SBATCH --account=s83
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=4
#SBATCH --partition=normal
#SBATCH --mem=444G
#SBATCH --no-requeue
#SBATCH --output=lightning_logs/neurwp_eval_out.log
#SBATCH --error=lightning_logs/neurwp_eval_err.log
export PREPROCESS=true
export NORMALIZE=false
export DATASET="cosmo"
export MODEL="hi_lam"
# Load necessary modules
conda activate neural-lam
if [ "$PREPROCESS" = true ]; then
echo "Create static features"
python create_static_features.py --boundaries 60 --dataset $DATASET
if [ "$MODEL" = "hi_lam" ]; then
echo "Creating hierarchical mesh"
python create_mesh.py --dataset $DATASET --plot 1 --graph hierarchical --levels 4 --hierarchical 1
else
echo "Creating flat mesh"
python create_mesh.py --dataset $DATASET --plot 1
fi
echo "Creating grid features"
python create_grid_features.py --dataset $DATASET
if [ "$NORMALIZE" = true ]; then
# This takes multiple hours!
echo "Creating normalization weights"
sbatch slurm_param.sh
fi
fi
echo "Evaluating model"
if [ "$MODEL" = "hi_lam" ]; then
srun -ul python train_model.py --dataset $DATASET --val_interval 2 --epochs 1 --n_workers 8 --batch_size 12 --subset_ds 1 --model hi_lam --graph hierarchical --load "wandb/example.ckpt" --eval="test"
else
srun -ul python train_model.py --dataset $DATASET --val_interval 2 --epochs 1 --n_workers 8 --batch_size 12 --subset_ds 1 --load "wandb/example.ckpt" --eval="test"
fi