Skip to content

Commit 657ccd1

Browse files
authored
Merge pull request #63 from NSAPH-Projects/automate-script-creation
Automate script creation
2 parents 0fb6054 + b006a14 commit 657ccd1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+747
-1207
lines changed

environment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ channels:
99
dependencies:
1010
- coverage=7.4.3
1111
- gudhi=3.8.0
12+
- jinja2=3.1.4
1213
- matplotlib=3.7.2
1314
- networkx=3.1
1415
- numpy=1.22.4

scripts/experiments/9.sh

Lines changed: 0 additions & 91 deletions
This file was deleted.

scripts/experiments/colab_parallel.ipynb

Lines changed: 0 additions & 781 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
experiment_name: "experiment_1"
2+
description: "isolated ranks: atoms + bonds"
3+
4+
# Dataset args
5+
lifters: ["atom:0", "bond:1", "supercell:2"]
6+
neighbor_types: "max"
7+
connectivity: "self"
8+
visible_dims: [0, 1]
9+
initial_features: "hetero"
10+
dim: 2
11+
12+
# Model args
13+
num_hidden: 128
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
#!/bin/bash
22

3-
# isolated ranks: atoms + bonds
3+
# Dataset generation script for experiment_1
44

55
# DEFINE EXP ARGUMENTS
6-
LIFTERS=("atom:0" "bond:1" "supercell:2")
6+
LIFTERS=(atom:0 bond:1 supercell:2)
77
NEIGHBOR_TYPES="max"
88
CONNECTIVITY="self"
99
VISIBLE_DIMS=(0 1)
1010
INITIAL_FEATURES="hetero"
1111
DIM=2
1212

13-
14-
# Train EGNN in parallel for each TARGET_NAME
13+
# Command to generate dataset
1514
python src/create_dataset.py --lifters "${LIFTERS[@]}" \
1615
--neighbor_types "$NEIGHBOR_TYPES" \
1716
--connectivity "$CONNECTIVITY" \
1817
--visible_dims "${VISIBLE_DIMS[@]}" \
1918
--initial_features "$INITIAL_FEATURES" \
20-
--dim "$DIM" \
21-
22-
23-
24-
25-
26-
19+
--dim "$DIM"

scripts/experiments/1.sh renamed to scripts/experiments/experiment_1/train_etnn.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
#!/bin/bash
22

3-
# isolated ranks: atoms + bonds
3+
# Training script for experiment_1
44

55
# DEFINE EXP ARGUMENTS
6-
LIFTERS=("atom:0" "bond:1" "supercell:2")
6+
EXP_NAME=experiment_1
7+
LIFTERS=(atom:0 bond:1 supercell:2)
78
DIM=2
89
VISIBLE_DIMS=(0 1)
910
INITIAL_FEATURES="hetero"
1011
NEIGHBOR_TYPES="max"
1112
CONNECTIVITY="self"
12-
EPOCHS=350
1313
NUM_HIDDEN=128
1414

1515
# Constants
16+
EPOCHS=350
1617
BATCH_SIZE=96
1718
WEIGHT_DECAY=1e-16
1819
MIN_LR=0
@@ -21,7 +22,6 @@ MODEL_NAME="ten"
2122
SPLITS="egnn"
2223
CHECKPOINT_DIR="checkpoints/"
2324

24-
2525
# Define the predefined target names lists
2626
TARGET_NAMES_0=("alpha")
2727
TARGET_NAMES_1=("mu" "alpha" "homo" "lumo" "gap" "r2")
@@ -50,7 +50,7 @@ esac
5050
for TARGET_NAME in "${TARGET_NAMES[@]}"
5151
do
5252
# Check if target is one of the first three
53-
if [[ "$target" == "gap" || "$target" == "homo" || "$target" == "lumo" ]]; then
53+
if [[ "$TARGET_NAME" == "gap" || "$TARGET_NAME" == "homo" || "$TARGET_NAME" == "lumo" ]]; then
5454
LR="1e-3"
5555
else
5656
LR="5e-4"
@@ -77,6 +77,7 @@ do
7777
--splits "$SPLITS" \
7878
--normalize_invariants \
7979
--clip_gradient \
80+
--run_name "${EXP_NAME} ${TARGET_NAME}" \
8081
--checkpoint_dir "$CHECKPOINT_DIR" &
8182

8283
# Wait for 30 minutes before moving to the next iteration
@@ -86,5 +87,4 @@ done
8687
# Wait for all background jobs to finish
8788
echo "All jobs have been launched."
8889
wait
89-
echo "All jobs have been completed."
90-
90+
echo "All jobs have been completed."
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
experiment_name: "experiment_10"
2+
description: "EGNN-like"
3+
4+
# Dataset args
5+
lifters: ["atom:0", "supercell:1"]
6+
neighbor_types: "max"
7+
connectivity: "self"
8+
visible_dims: [0]
9+
initial_features: "hetero"
10+
dim: 1
11+
12+
# Model args
13+
num_hidden: 128
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Dataset generation script for experiment_10
4+
5+
# DEFINE EXP ARGUMENTS
6+
LIFTERS=(atom:0 supercell:1)
7+
NEIGHBOR_TYPES="max"
8+
CONNECTIVITY="self"
9+
VISIBLE_DIMS=(0)
10+
INITIAL_FEATURES="hetero"
11+
DIM=1
12+
13+
# Command to generate dataset
14+
python src/create_dataset.py --lifters "${LIFTERS[@]}" \
15+
--neighbor_types "$NEIGHBOR_TYPES" \
16+
--connectivity "$CONNECTIVITY" \
17+
--visible_dims "${VISIBLE_DIMS[@]}" \
18+
--initial_features "$INITIAL_FEATURES" \
19+
--dim "$DIM"

scripts/experiments/8.sh renamed to scripts/experiments/experiment_10/train_etnn.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
#!/bin/bash
22

3-
# EGNN-like, no VC
3+
# Training script for experiment_10
44

55
# DEFINE EXP ARGUMENTS
6-
LIFTERS=("atom:0" "bond:1")
6+
EXP_NAME=experiment_10
7+
LIFTERS=(atom:0 supercell:1)
78
DIM=1
89
VISIBLE_DIMS=(0)
910
INITIAL_FEATURES="hetero"
1011
NEIGHBOR_TYPES="max"
1112
CONNECTIVITY="self"
12-
EPOCHS=350
1313
NUM_HIDDEN=128
1414

1515
# Constants
16+
EPOCHS=350
1617
BATCH_SIZE=96
1718
WEIGHT_DECAY=1e-16
1819
MIN_LR=0
@@ -21,7 +22,6 @@ MODEL_NAME="ten"
2122
SPLITS="egnn"
2223
CHECKPOINT_DIR="checkpoints/"
2324

24-
2525
# Define the predefined target names lists
2626
TARGET_NAMES_0=("alpha")
2727
TARGET_NAMES_1=("mu" "alpha" "homo" "lumo" "gap" "r2")
@@ -50,7 +50,7 @@ esac
5050
for TARGET_NAME in "${TARGET_NAMES[@]}"
5151
do
5252
# Check if target is one of the first three
53-
if [[ "$target" == "gap" || "$target" == "homo" || "$target" == "lumo" ]]; then
53+
if [[ "$TARGET_NAME" == "gap" || "$TARGET_NAME" == "homo" || "$TARGET_NAME" == "lumo" ]]; then
5454
LR="1e-3"
5555
else
5656
LR="5e-4"
@@ -77,14 +77,14 @@ do
7777
--splits "$SPLITS" \
7878
--normalize_invariants \
7979
--clip_gradient \
80+
--run_name "${EXP_NAME} ${TARGET_NAME}" \
8081
--checkpoint_dir "$CHECKPOINT_DIR" &
81-
82+
8283
# Wait for 30 minutes before moving to the next iteration
8384
sleep 1800
8485
done
8586

8687
# Wait for all background jobs to finish
8788
echo "All jobs have been launched."
8889
wait
89-
echo "All jobs have been completed."
90-
90+
echo "All jobs have been completed."
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
experiment_name: "experiment_11"
2+
description: "EGNN-Wide"
3+
4+
# Dataset args
5+
lifters: ["atom:0", "supercell:1"]
6+
neighbor_types: "max"
7+
connectivity: "self"
8+
visible_dims: [0]
9+
initial_features: "hetero"
10+
dim: 1
11+
12+
# Model args
13+
num_hidden: 182

0 commit comments

Comments
 (0)