-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update datamodule.py to make it compatible with OGB-lSC
- Loading branch information
Showing
2 changed files
with
241 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
constants: | ||
seed: &seed 42 | ||
raise_train_error: True # Whether the code should raise an error if it crashes during training | ||
|
||
datamodule: | ||
module_type: "DGLOGBDataModule" | ||
args: | ||
cache_data_path: null | ||
dataset_name: "ogbg-molpcqm4m" | ||
|
||
|
||
# Weights | ||
weights_type: null | ||
sample_size: 10000 | ||
|
||
# Featurization | ||
featurization_n_jobs: 8 | ||
featurization_progress: True | ||
featurization: | ||
atom_property_list_onehot: [atomic-number, valence] | ||
atom_property_list_float: [mass, electronegativity, in-ring, hybridization, chirality, aromatic, degree, formal-charge, single-bond, double-bond, radical-electron, vdw-radius, covalent-radius, metal] | ||
edge_property_list: [bond-type-onehot, bond-type-float, stereo, in-ring, conjugated, estimated-bond-length] | ||
add_self_loop: False | ||
explicit_H: False | ||
use_bonds_weights: False | ||
pos_encoding_as_features: &pos_enc | ||
pos_type: laplacian_eigvec | ||
num_pos: 3 | ||
normalization: "none" | ||
disconnected_comp: True | ||
pos_encoding_as_directions: *pos_enc | ||
|
||
# Train, val, test parameters | ||
batch_size_train_val: 1500 | ||
batch_size_test: 1500 | ||
|
||
# Data loading | ||
num_workers: 0 | ||
pin_memory: False | ||
persistent_workers: False # Keep True on Windows if running multiple workers | ||
|
||
|
||
architecture: | ||
model_type: fulldglnetwork | ||
pre_nn: # Set as null to avoid a pre-nn network | ||
out_dim: &hidden_dim 420 | ||
hidden_dims: *hidden_dim | ||
depth: 3 | ||
activation: relu | ||
last_activation: none | ||
dropout: &dropout_mlp 0.2 | ||
last_dropout: *dropout_mlp | ||
batch_norm: &batch_norm True | ||
last_batch_norm: *batch_norm | ||
residual_type: simple | ||
|
||
pre_nn_edges: # Set as null to avoid a pre-nn network | ||
out_dim: 32 | ||
hidden_dims: 32 | ||
depth: 3 | ||
activation: relu | ||
last_activation: none | ||
dropout: *dropout_mlp | ||
last_dropout: *dropout_mlp | ||
batch_norm: *batch_norm | ||
last_batch_norm: *batch_norm | ||
residual_type: simple | ||
|
||
gnn: # Set as null to avoid a post-nn network | ||
out_dim: *hidden_dim | ||
hidden_dims: *hidden_dim | ||
depth: 5 | ||
activation: none | ||
last_activation: none | ||
dropout: &dropout_gnn 0.2 | ||
last_dropout: *dropout_gnn | ||
batch_norm: *batch_norm | ||
last_batch_norm: *batch_norm | ||
residual_type: simple | ||
pooling: ['sum', 'max', 'dir1'] | ||
virtual_node: 'none' | ||
layer_type: 'dgn-msgpass' | ||
layer_kwargs: | ||
# num_heads: 3 | ||
aggregators: [mean, max, sum, dir1/dx_abs] | ||
scalers: [identity] | ||
|
||
post_nn: | ||
out_dim: 1 | ||
hidden_dims: *hidden_dim | ||
depth: 3 | ||
activation: relu | ||
last_activation: none | ||
dropout: *dropout_mlp | ||
last_dropout: 0. | ||
batch_norm: *batch_norm | ||
last_batch_norm: False | ||
residual_type: simple | ||
|
||
predictor: | ||
metrics_on_progress_bar: ["mae", "mse", "pearsonr"] | ||
loss_fun: bce | ||
random_seed: *seed | ||
optim_kwargs: | ||
lr: 5.e-3 | ||
weight_decay: 0 | ||
lr_reduce_on_plateau_kwargs: | ||
factor: 0.5 | ||
patience: 20 | ||
min_lr: 2.e-4 | ||
scheduler_kwargs: | ||
monitor: &monitor mae/val | ||
mode: &mode max | ||
frequency: 1 | ||
target_nan_mask: 0 # null: no mask, 0: 0 mask, ignore: ignore nan values from loss | ||
|
||
|
||
metrics: | ||
- name: mae | ||
metric: mae | ||
threshold_kwargs: null | ||
|
||
- name: pearsonr | ||
metric: pearsonr | ||
threshold_kwargs: null | ||
|
||
- name: mse | ||
metric: mse | ||
threshold_kwargs: null | ||
|
||
- name: spearmanr | ||
metric: spearmanr | ||
threshold_kwargs: null | ||
|
||
|
||
- name: f1 > 5 | ||
metric: f1 | ||
num_classes: 2 | ||
average: micro | ||
threshold_kwargs: &threshold_1 | ||
operator: greater | ||
threshold: 5 | ||
th_on_preds: True | ||
th_on_target: True | ||
target_to_int: True | ||
|
||
- name: f1 > 4 | ||
metric: f1 | ||
num_classes: 2 | ||
average: micro | ||
threshold_kwargs: &threshold_2 | ||
operator: greater | ||
threshold: 4 | ||
th_on_preds: True | ||
th_on_target: True | ||
target_to_int: True | ||
|
||
|
||
trainer: | ||
logger: | ||
save_dir: logs/ogb-molpcqm4m | ||
early_stopping: | ||
monitor: *monitor | ||
min_delta: 0 | ||
patience: 80 | ||
mode: *mode | ||
model_checkpoint: | ||
dirpath: models_checkpoints/ogb-molpcqm4m/ | ||
filename: "model" | ||
monitor: *monitor | ||
mode: *mode | ||
save_top_k: 1 | ||
period: 1 | ||
trainer: | ||
max_epochs: 1000 | ||
min_epochs: 100 | ||
gpus: 1 | ||
accumulate_grad_batches: 1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters