Skip to content

Commit

Permalink
update results of training.
Browse files Browse the repository at this point in the history
  • Loading branch information
PatReis committed Dec 21, 2023
1 parent eb42647 commit 89b4d09
Show file tree
Hide file tree
Showing 9 changed files with 558 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kgcnn/models/casting.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def template_cast_list_input(model_inputs,

if input_tensor_type in ["padded", "masked"]:
if mask_assignment is None or not isinstance(mask_assignment, (list, tuple)):
raise ValueError()
raise ValueError("Mask assignment information is required or invalid.")

reduced_mask = [x for x in mask_assignment if x is not None]
if len(reduced_mask) == 0:
Expand Down
50 changes: 50 additions & 0 deletions kgcnn/ops/scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ def compute_output_spec(self, indices, values, shape):


def scatter_reduce_max(indices, values, shape):
r"""Scatter values at indices into new tensor of shape.
Args:
indices (Tensor): 1D Indices of shape `(M, )` .
values (Tensor): Vales of shape `(M, ...)` .
shape (tuple): Target shape.
Returns:
Tensor: Scattered values of `shape` .
"""
if any_symbolic_tensors((indices, values, shape)):
return _ScatterMax().symbolic_call(indices, values, shape)
return kgcnn_backend.scatter_reduce_max(indices, values, shape)
Expand All @@ -27,6 +37,16 @@ def compute_output_spec(self, indices, values, shape):


def scatter_reduce_min(indices, values, shape):
r"""Scatter values at indices into new tensor of shape.
Args:
indices (Tensor): 1D Indices of shape `(M, )` .
values (Tensor): Vales of shape `(M, ...)` .
shape (tuple): Target shape.
Returns:
Tensor: Scattered values of `shape` .
"""
if any_symbolic_tensors((indices, values, shape)):
return _ScatterMin().symbolic_call(indices, values, shape)
return kgcnn_backend.scatter_reduce_min(indices, values, shape)
Expand All @@ -41,6 +61,16 @@ def compute_output_spec(self, indices, values, shape):


def scatter_reduce_mean(indices, values, shape):
r"""Scatter values at indices into new tensor of shape.
Args:
indices (Tensor): 1D Indices of shape `(M, )` .
values (Tensor): Vales of shape `(M, ...)` .
shape (tuple): Target shape.
Returns:
Tensor: Scattered values of `shape` .
"""
if any_symbolic_tensors((indices, values, shape)):
return _ScatterMean().symbolic_call(indices, values, shape)
return kgcnn_backend.scatter_reduce_mean(indices, values, shape)
Expand All @@ -55,6 +85,16 @@ def compute_output_spec(self, indices, values, shape):


def scatter_reduce_sum(indices, values, shape):
r"""Scatter values at indices into new tensor of shape.
Args:
indices (Tensor): 1D Indices of shape `(M, )` .
values (Tensor): Vales of shape `(M, ...)` .
shape (tuple): Target shape.
Returns:
Tensor: Scattered values of `shape` .
"""
if any_symbolic_tensors((indices, values, shape)):
return _ScatterSum().symbolic_call(indices, values, shape)
return kgcnn_backend.scatter_reduce_sum(indices, values, shape)
Expand All @@ -74,6 +114,16 @@ def compute_output_spec(self, indices, values, shape):


def scatter_reduce_softmax(indices, values, shape, normalize: bool = False):
r"""Scatter values at indices to normalize values via softmax.
Args:
indices (Tensor): 1D Indices of shape `(M, )` .
values (Tensor): Vales of shape `(M, ...)` .
shape (tuple): Target shape of scattered tensor.
Returns:
Tensor: Values with softmax computed by grouping at indices.
"""
if any_symbolic_tensors((indices, values, shape)):
return _ScatterSoftmax(normalize=normalize).symbolic_call(indices, values, shape)
return kgcnn_backend.scatter_reduce_softmax(indices, values, shape, normalize=normalize)
4 changes: 3 additions & 1 deletion training/hyper/hyper_qm9_orbitals.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
{"shape": [None, 3], "name": "node_coordinates", "dtype": "float32", "ragged": True},
{"shape": [None, 2], "name": "range_indices", "dtype": "int64", "ragged": True}
],
"input_embedding": {"node": {"input_dim": 95, "output_dim": 128}},
"input_tensor_type": "ragged",
"input_embedding": None,
"input_node_embedding": {"input_dim": 95, "output_dim": 128},
"bessel_basis": {"num_radial": 20, "cutoff": 5.0, "envelope_exponent": 5},
"pooling_args": {"pooling_method": "sum"}, "conv_args": {"units": 128, "cutoff": None},
"update_args": {"units": 128}, "depth": 3, "verbose": 10,
Expand Down
137 changes: 137 additions & 0 deletions training/results/ESOLDataset/CMPNN/CMPNN_ESOLDataset_score.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
OS: posix_linux
backend: tensorflow
cuda_available: 'True'
data_unit: mol/L
date_time: '2023-12-20 23:54:16'
device_id: '[LogicalDevice(name=''/device:CPU:0'', device_type=''CPU''), LogicalDevice(name=''/device:GPU:0'',
device_type=''GPU'')]'
device_memory: '[]'
device_name: '[{}, {''compute_capability'': (7, 0), ''device_name'': ''Tesla V100-SXM2-32GB''}]'
epochs:
- 600
- 600
- 600
- 600
- 600
execute_folds: null
kgcnn_version: 4.0.0
loss:
- 0.00023183324083220214
- 0.00017752200074028224
- 0.00018914483371190727
- 0.0001874043809948489
- 1.900034476420842e-05
max_loss:
- 1.1973497867584229
- 1.0974987745285034
- 1.4608932733535767
- 1.2774747610092163
- 1.125367522239685
max_scaled_mean_absolute_error:
- 1.715080976486206
- 1.685046911239624
- 1.8969279527664185
- 1.7868362665176392
- 1.7247272729873657
max_scaled_root_mean_squared_error:
- 2.3039710521698
- 2.257887125015259
- 2.608121633529663
- 2.406620979309082
- 2.245151996612549
max_val_loss:
- 0.7626262307167053
- 1.6030727624893188
- 0.7904647588729858
- 0.939492404460907
- 0.7619210481643677
max_val_scaled_mean_absolute_error:
- 1.3947796821594238
- 2.2608180046081543
- 1.5816482305526733
- 1.5697236061096191
- 1.4567921161651611
max_val_scaled_root_mean_squared_error:
- 1.8257416486740112
- 2.6560630798339844
- 1.8949168920516968
- 2.023801803588867
- 1.8428680896759033
min_loss:
- 0.00023183324083220214
- 0.00017752200074028224
- 0.00018914483371190727
- 0.00018653765437193215
- 1.8690105207497254e-05
min_scaled_mean_absolute_error:
- 0.005625245161354542
- 0.005176743026822805
- 0.005119773093611002
- 0.0039019521791487932
- 0.0043538580648601055
min_scaled_root_mean_squared_error:
- 0.032370418310165405
- 0.028836989775300026
- 0.029924051836133003
- 0.029095962643623352
- 0.009313425980508327
min_val_loss:
- 0.09925275295972824
- 0.0914703980088234
- 0.09436161816120148
- 0.0922454372048378
- 0.08730437606573105
min_val_scaled_mean_absolute_error:
- 0.4868481457233429
- 0.46619078516960144
- 0.4638049304485321
- 0.4697567820549011
- 0.4539531469345093
min_val_scaled_root_mean_squared_error:
- 0.6407178640365601
- 0.6302186250686646
- 0.6600759625434875
- 0.6400931477546692
- 0.6043533086776733
model_class: make_model
model_name: CMPNN
model_version: '2023-10-30'
multi_target_indices: null
number_histories: 5
scaled_mean_absolute_error:
- 0.005625245161354542
- 0.005188747774809599
- 0.005194343626499176
- 0.004212634172290564
- 0.004786244127899408
scaled_root_mean_squared_error:
- 0.032370418310165405
- 0.028836989775300026
- 0.029924051836133003
- 0.029157962650060654
- 0.009391490370035172
seed: 42
time_list:
- '0:12:35.362480'
- '0:12:35.969232'
- '0:12:42.460222'
- '0:12:35.954069'
- '0:12:26.994579'
val_loss:
- 0.13186116516590118
- 0.1403244137763977
- 0.11817561089992523
- 0.12358944118022919
- 0.1467534303665161
val_scaled_mean_absolute_error:
- 0.5213338732719421
- 0.5559774041175842
- 0.5131708979606628
- 0.5310410857200623
- 0.5166580080986023
val_scaled_root_mean_squared_error:
- 0.7463422417640686
- 0.7871690988540649
- 0.7463598251342773
- 0.7365252375602722
- 0.7358969449996948
1 change: 1 addition & 0 deletions training/results/ESOLDataset/CMPNN/CMPNN_hyper.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"model": {"class_name": "make_model", "module_name": "kgcnn.literature.CMPNN", "config": {"name": "CMPNN", "inputs": [{"shape": [null, 41], "name": "node_attributes", "dtype": "float32"}, {"shape": [null, 11], "name": "edge_attributes", "dtype": "float32"}, {"shape": [null, 2], "name": "edge_indices", "dtype": "int64"}, {"shape": [null, 1], "name": "edge_indices_reverse", "dtype": "int64"}, {"shape": [], "name": "total_nodes", "dtype": "int64"}, {"shape": [], "name": "total_edges", "dtype": "int64"}, {"shape": [], "name": "total_reverse", "dtype": "int64"}], "input_tensor_type": "padded", "input_node_embedding": {"input_dim": 95, "output_dim": 64}, "input_edge_embedding": {"input_dim": 5, "output_dim": 64}, "node_initialize": {"units": 300, "activation": "relu"}, "edge_initialize": {"units": 300, "activation": "relu"}, "edge_dense": {"units": 300, "activation": "linear"}, "node_dense": {"units": 300, "activation": "linear"}, "edge_activation": {"activation": "relu"}, "verbose": 10, "depth": 5, "dropout": null, "use_final_gru": true, "pooling_gru": {"units": 300}, "pooling_kwargs": {"pooling_method": "sum"}, "output_embedding": "graph", "output_mlp": {"use_bias": [true, false], "units": [300, 1], "activation": ["relu", "linear"]}}}, "training": {"fit": {"batch_size": 50, "epochs": 600, "validation_freq": 1, "verbose": 2, "callbacks": []}, "compile": {"optimizer": {"class_name": "Adam", "config": {"learning_rate": {"class_name": "ExponentialDecay", "module": "keras.optimizers.schedules", "config": {"initial_learning_rate": 0.001, "decay_steps": 1600, "decay_rate": 0.5, "staircase": false}}}}, "loss": "mean_squared_error"}, "cross_validation": {"class_name": "KFold", "config": {"n_splits": 5, "random_state": 42, "shuffle": true}}, "scaler": {"class_name": "StandardLabelScaler", "config": {"with_std": true, "with_mean": true, "copy": true}}}, "data": {"data_unit": "mol/L"}, "info": {"postfix": "", "postfix_file": "", "kgcnn_version": "4.0.0"}, "dataset": {"class_name": "ESOLDataset", "module_name": "kgcnn.data.datasets.ESOLDataset", "config": {}, "methods": [{"set_attributes": {}}, {"map_list": {"method": "set_edge_indices_reverse"}}, {"map_list": {"method": "count_nodes_and_edges"}}, {"map_list": {"method": "count_nodes_and_edges", "total_edges": "total_reverse"}}]}}
137 changes: 137 additions & 0 deletions training/results/QM7Dataset/DimeNetPP/DimeNetPP_QM7Dataset_score.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
OS: posix_linux
backend: tensorflow
cuda_available: 'True'
data_unit: kcal/mol
date_time: '2023-12-21 04:45:11'
device_id: '[LogicalDevice(name=''/device:CPU:0'', device_type=''CPU''), LogicalDevice(name=''/device:GPU:0'',
device_type=''GPU'')]'
device_memory: '[]'
device_name: '[{}, {''compute_capability'': (7, 0), ''device_name'': ''Tesla V100-SXM2-32GB''}]'
epochs:
- 872
- 872
- 872
- 872
- 872
execute_folds: null
kgcnn_version: 4.0.0
loss:
- 0.0005192547105252743
- 0.0005859421798959374
- 0.0005881146644242108
- 0.00038828517426736653
- 0.00042653322452679276
max_loss:
- 0.39550185203552246
- 0.3835352957248688
- 0.39535853266716003
- 0.40081343054771423
- 0.3717119097709656
max_scaled_mean_absolute_error:
- 88.4721450805664
- 85.88572692871094
- 88.60206604003906
- 89.8046646118164
- 83.19475555419922
max_scaled_root_mean_squared_error:
- 131.0218505859375
- 130.70944213867188
- 129.65948486328125
- 136.13157653808594
- 121.79318237304688
max_val_loss:
- 0.07793247699737549
- 0.05247681587934494
- 0.06055280938744545
- 0.08880073577165604
- 0.0839301124215126
max_val_scaled_mean_absolute_error:
- 17.380496978759766
- 11.777695655822754
- 13.62238883972168
- 19.90665054321289
- 18.728012084960938
max_val_scaled_root_mean_squared_error:
- 23.846885681152344
- 15.797113418579102
- 18.345048904418945
- 26.381744384765625
- 23.828720092773438
min_loss:
- 0.0005192547105252743
- 0.0005859421798959374
- 0.0005805905675515532
- 0.00038581088301725686
- 0.0004265273455530405
min_scaled_mean_absolute_error:
- 0.11637404561042786
- 0.13132883608341217
- 0.1302138864994049
- 0.08653981983661652
- 0.09565576165914536
min_scaled_root_mean_squared_error:
- 0.20463432371616364
- 0.20020626485347748
- 0.203572615981102
- 0.13961230218410492
- 0.16126485168933868
min_val_loss:
- 0.017145873978734016
- 0.015065383166074753
- 0.01469708327203989
- 0.015139556489884853
- 0.015097062103450298
min_val_scaled_mean_absolute_error:
- 3.8343989849090576
- 3.376465082168579
- 3.295900583267212
- 3.3965675830841064
- 3.384349822998047
min_val_scaled_root_mean_squared_error:
- 10.640360832214355
- 5.686461925506592
- 7.498864650726318
- 7.203327178955078
- 6.20181131362915
model_class: make_model
model_name: DimeNetPP
model_version: '2023-12-04'
multi_target_indices: null
number_histories: 5
scaled_mean_absolute_error:
- 0.11637404561042786
- 0.13132883608341217
- 0.13185767829418182
- 0.08708549290895462
- 0.09565749019384384
scaled_root_mean_squared_error:
- 0.20463432371616364
- 0.20020626485347748
- 0.203572615981102
- 0.13961230218410492
- 0.16126485168933868
seed: 42
time_list:
- '6:59:19.071354'
- '7:00:28.823901'
- '6:50:30.302822'
- '6:46:21.878251'
- '6:55:38.207034'
val_loss:
- 0.01725739613175392
- 0.015085577964782715
- 0.014698205515742302
- 0.015139556489884853
- 0.015109173022210598
val_scaled_mean_absolute_error:
- 3.8581318855285645
- 3.381181478500366
- 3.2967283725738525
- 3.3965675830841064
- 3.3870768547058105
val_scaled_root_mean_squared_error:
- 10.91750431060791
- 5.7236785888671875
- 7.511663436889648
- 7.305181503295898
- 6.205348014831543
1 change: 1 addition & 0 deletions training/results/QM7Dataset/DimeNetPP/DimeNetPP_hyper.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"model": {"class_name": "make_model", "module_name": "kgcnn.literature.DimeNetPP", "config": {"name": "DimeNetPP", "inputs": [{"shape": [null], "name": "node_number", "dtype": "int64", "ragged": true}, {"shape": [null, 3], "name": "node_coordinates", "dtype": "float32", "ragged": true}, {"shape": [null, 2], "name": "range_indices", "dtype": "int64", "ragged": true}, {"shape": [null, 2], "name": "angle_indices", "dtype": "int64", "ragged": true}], "input_tensor_type": "ragged", "input_embedding": null, "input_node_embedding": {"input_dim": 95, "output_dim": 128, "embeddings_initializer": {"class_name": "RandomUniform", "config": {"minval": -1.7320508075688772, "maxval": 1.7320508075688772}}}, "emb_size": 128, "out_emb_size": 256, "int_emb_size": 64, "basis_emb_size": 8, "num_blocks": 4, "num_spherical": 7, "num_radial": 6, "cutoff": 5.0, "envelope_exponent": 5, "num_before_skip": 1, "num_after_skip": 2, "num_dense_output": 3, "num_targets": 1, "extensive": false, "output_init": "zeros", "activation": "swish", "verbose": 10, "output_embedding": "graph", "use_output_mlp": false, "output_mlp": {}}}, "training": {"fit": {"batch_size": 10, "epochs": 872, "validation_freq": 10, "verbose": 2, "callbacks": []}, "compile": {"optimizer": {"class_name": "Adam", "config": {"learning_rate": {"class_name": "kgcnn>LinearWarmupExponentialDecay", "config": {"learning_rate": 0.001, "warmup_steps": 150.0, "decay_steps": 200000.0, "decay_rate": 0.01}}, "use_ema": true, "amsgrad": true}}, "loss": "mean_absolute_error"}, "scaler": {"class_name": "QMGraphLabelScaler", "config": {"atomic_number": "node_number", "scaler": [{"class_name": "StandardLabelScaler", "config": {"with_std": true, "with_mean": true, "copy": true}}]}}, "multi_target_indices": null}, "data": {"data_unit": "kcal/mol"}, "info": {"postfix": "", "postfix_file": "", "kgcnn_version": "4.0.0"}, "dataset": {"class_name": "QM7Dataset", "module_name": "kgcnn.data.datasets.QM7Dataset", "config": {}, "methods": [{"map_list": {"method": "set_range", "max_distance": 5, "max_neighbours": 1000}}, {"map_list": {"method": "set_angle"}}]}}
Loading

0 comments on commit 89b4d09

Please sign in to comment.