Skip to content

Commit

Permalink
fix default for ExtensiveMolecularLabelScaler and added further bench…
Browse files Browse the repository at this point in the history
…mark values.
  • Loading branch information
PatReis committed Jan 16, 2024
1 parent 48004cf commit 9b43be6
Show file tree
Hide file tree
Showing 10 changed files with 388 additions and 19 deletions.
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
v4.0.1

*
* Fix Error in ``ExtensiveMolecularLabelScaler.transform`` missing default value.
* Added further benchmark results for kgcnn version 4.


v4.0.0

Expand Down
2 changes: 1 addition & 1 deletion kgcnn/data/transform/scaler/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def fit(self, y: Union[None, list, np.ndarray] = None, *, X=None, sample_weight=
molecular_property=y, sample_weight=sample_weight, atomic_number=atomic_number)

# noinspection PyPep8Naming
def transform(self, y=None, *, X, copy=True, atomic_number=None):
def transform(self, y=None, *, X=None, copy=True, atomic_number=None):
"""Transform any atomic number list with matching labels based on previous fit with sequential std-scaling.
Args:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
OS: posix_linux
backend: tensorflow
cuda_available: 'True'
data_unit: ''
date_time: '2024-01-16 04:12:09'
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''}]'
energy_scaled_mean_absolute_error:
- 0.03285173699259758
epochs:
- 1000
execute_folds: null
force_scaled_mean_absolute_error:
- 0.12179367244243622
kgcnn_version: 4.0.0
loss:
- 0.02105969749391079
max_energy_scaled_mean_absolute_error:
- 18.0843448638916
max_force_scaled_mean_absolute_error:
- 16.618600845336914
max_loss:
- 2.9480459690093994
max_val_energy_scaled_mean_absolute_error:
- 10.387165069580078
max_val_force_scaled_mean_absolute_error:
- 10.291943550109863
max_val_loss:
- 1.8392095565795898
min_energy_scaled_mean_absolute_error:
- 0.032832562923431396
min_force_scaled_mean_absolute_error:
- 0.12179330736398697
min_loss:
- 0.02105969749391079
min_val_energy_scaled_mean_absolute_error:
- 0.052257902920246124
min_val_force_scaled_mean_absolute_error:
- 0.2815096080303192
min_val_loss:
- 0.04943711310625076
model_class: EnergyForceModel
model_name: PAiNN
model_version: ''
multi_target_indices: null
number_histories: 1
seed: 42
time_list:
- '0:19:00.800728'
trajectory_name: toluene_ccsd_t
val_energy_scaled_mean_absolute_error:
- 0.052314795553684235
val_force_scaled_mean_absolute_error:
- 0.28150975704193115
val_loss:
- 0.0494372732937336
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"model": {"class_name": "EnergyForceModel", "module_name": "kgcnn.models.force", "config": {"name": "PAiNN", "nested_model_config": true, "output_to_tensor": false, "output_squeeze_states": true, "coordinate_input": 1, "inputs": [{"shape": [null], "name": "atomic_number", "dtype": "int32"}, {"shape": [null, 3], "name": "node_coordinates", "dtype": "float32"}, {"shape": [null, 2], "name": "range_indices", "dtype": "int64"}, {"shape": [], "name": "total_nodes", "dtype": "int64"}, {"shape": [], "name": "total_ranges", "dtype": "int64"}], "model_energy": {"class_name": "make_model", "module_name": "kgcnn.literature.PAiNN", "config": {"name": "PAiNNEnergy", "inputs": [{"shape": [null], "name": "atomic_number", "dtype": "int32"}, {"shape": [null, 3], "name": "node_coordinates", "dtype": "float32"}, {"shape": [null, 2], "name": "range_indices", "dtype": "int64"}, {"shape": [], "name": "total_nodes", "dtype": "int64"}, {"shape": [], "name": "total_ranges", "dtype": "int64"}], "input_embedding": null, "input_node_embedding": {"input_dim": 95, "output_dim": 128}, "equiv_initialize_kwargs": {"dim": 3, "method": "eps"}, "bessel_basis": {"num_radial": 20, "cutoff": 5.0, "envelope_exponent": 5}, "pooling_args": {"pooling_method": "scatter_sum"}, "conv_args": {"units": 128, "cutoff": null}, "update_args": {"units": 128}, "depth": 3, "verbose": 10, "output_embedding": "graph", "output_mlp": {"use_bias": [true, true], "units": [128, 1], "activation": ["swish", "linear"]}}}, "outputs": {"energy": {"name": "energy", "shape": [1]}, "force": {"name": "force", "shape": [null, 3]}}}}, "training": {"fit": {"batch_size": 32, "epochs": 1000, "validation_freq": 1, "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": 20000.0, "decay_rate": 0.01}}, "amsgrad": true, "use_ema": true}}, "loss_weights": {"energy": 0.02, "force": 0.98}}, "scaler": {"class_name": "EnergyForceExtensiveLabelScaler", "config": {"standardize_scale": true}}}, "data": {}, "dataset": {"class_name": "MD17Dataset", "module_name": "kgcnn.data.datasets.MD17Dataset", "config": {"trajectory_name": "toluene_ccsd_t"}, "methods": [{"rename_property_on_graphs": {"old_property_name": "E", "new_property_name": "energy"}}, {"rename_property_on_graphs": {"old_property_name": "F", "new_property_name": "force"}}, {"rename_property_on_graphs": {"old_property_name": "z", "new_property_name": "atomic_number"}}, {"rename_property_on_graphs": {"old_property_name": "R", "new_property_name": "node_coordinates"}}, {"map_list": {"method": "set_range", "max_distance": 5, "max_neighbours": 10000, "node_coordinates": "node_coordinates"}}, {"map_list": {"method": "count_nodes_and_edges", "total_edges": "total_ranges", "count_edges": "range_indices", "count_nodes": "atomic_number", "total_nodes": "total_nodes"}}]}, "info": {"postfix": "", "postfix_file": "_toluene_ccsd_t", "kgcnn_version": "4.0.0"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
OS: posix_linux
auc:
- 0.985973596572876
- 0.9839138984680176
- 0.9861948490142822
- 0.9855550527572632
- 0.9856386184692383
backend: tensorflow
binary_accuracy:
- 0.9414876699447632
- 0.9368806481361389
- 0.9412166476249695
- 0.9404390454292297
- 0.9414883852005005
cuda_available: 'True'
data_unit: ''
date_time: '2024-01-15 05:32:20'
device_id: '[LogicalDevice(name=''/device:CPU:0'', device_type=''CPU''), LogicalDevice(name=''/device:GPU:0'',
device_type=''GPU'')]'
device_memory: '[]'
device_name: '[{}, {''compute_capability'': (8, 0), ''device_name'': ''NVIDIA A100
80GB PCIe''}]'
epochs:
- 100
- 100
- 100
- 100
- 100
execute_folds:
- 4
kgcnn_version: 4.0.0
learning_rate:
- 0.0005000000237487257
- 0.0005000000237487257
- 0.0005000000237487257
- 0.0005000000237487257
- 0.0005000000237487257
loss:
- 0.14746417105197906
- 0.1582603007555008
- 0.14631052315235138
- 0.14983642101287842
- 0.14866451919078827
max_auc:
- 0.985973596572876
- 0.9845299124717712
- 0.9862654209136963
- 0.9855550527572632
- 0.9860759973526001
max_binary_accuracy:
- 0.9414876699447632
- 0.9387069940567017
- 0.9413580894470215
- 0.9404390454292297
- 0.9417946934700012
max_learning_rate:
- 0.0005000000237487257
- 0.0005000000237487257
- 0.0005000000237487257
- 0.0005000000237487257
- 0.0005000000237487257
max_loss:
- 0.3786495625972748
- 0.38078606128692627
- 0.38107830286026
- 0.37777355313301086
- 0.3760170340538025
max_val_auc:
- 0.9533622860908508
- 0.957158625125885
- 0.9559903740882874
- 0.9531893730163574
- 0.9502664804458618
max_val_binary_accuracy:
- 0.8992365002632141
- 0.9014044404029846
- 0.9030539989471436
- 0.8986709117889404
- 0.8951312899589539
max_val_loss:
- 0.31014856696128845
- 0.2969925105571747
- 0.315784215927124
- 0.30748578906059265
- 0.32646846771240234
min_auc:
- 0.9011964201927185
- 0.900171160697937
- 0.9001192450523376
- 0.9021586775779724
- 0.90262371301651
min_binary_accuracy:
- 0.8372588753700256
- 0.8358214497566223
- 0.8344546556472778
- 0.8377891182899475
- 0.8387807607650757
min_learning_rate:
- 0.0005000000237487257
- 0.0005000000237487257
- 0.0005000000237487257
- 0.0005000000237487257
- 0.0005000000237487257
min_loss:
- 0.14746417105197906
- 0.15462714433670044
- 0.14631052315235138
- 0.14983642101287842
- 0.1462867558002472
min_val_auc:
- 0.938513457775116
- 0.9424667358398438
- 0.9377878308296204
- 0.9373155832290649
- 0.9327237010002136
min_val_binary_accuracy:
- 0.8760015368461609
- 0.8769912123680115
- 0.876708447933197
- 0.878358006477356
- 0.8668520450592041
min_val_loss:
- 0.26865243911743164
- 0.2629318833351135
- 0.2703554034233093
- 0.26852232217788696
- 0.28128594160079956
model_class: make_crystal_model
model_name: Megnet
model_version: '2023-12-05'
multi_target_indices: null
number_histories: 5
seed: 42
time_list:
- '3:44:57.701682'
- '3:46:09.783176'
- '3:47:50.495260'
- '3:53:23.545506'
- '3:55:38.012157'
val_auc:
- 0.9493050575256348
- 0.954775333404541
- 0.9515509605407715
- 0.9506537318229675
- 0.9468113780021667
val_binary_accuracy:
- 0.8919785022735596
- 0.9014044404029846
- 0.8982467651367188
- 0.8972099423408508
- 0.894188642501831
val_loss:
- 0.31014856696128845
- 0.29130005836486816
- 0.315784215927124
- 0.3024505376815796
- 0.32646846771240234
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"model": {"module_name": "kgcnn.literature.Megnet", "class_name": "make_crystal_model", "config": {"name": "Megnet", "inputs": [{"shape": [null], "name": "node_number", "dtype": "int32", "ragged": true}, {"shape": [null, 3], "name": "node_coordinates", "dtype": "float32", "ragged": true}, {"shape": [null, 2], "name": "range_indices", "dtype": "int64", "ragged": true}, {"shape": [1], "name": "charge", "dtype": "float32", "ragged": false}, {"shape": [null, 3], "name": "range_image", "dtype": "int64", "ragged": true}, {"shape": [3, 3], "name": "graph_lattice", "dtype": "float32", "ragged": false}], "input_tensor_type": "ragged", "input_embedding": null, "input_node_embedding": {"input_dim": 95, "output_dim": 64}, "make_distance": true, "expand_distance": true, "gauss_args": {"bins": 25, "distance": 5, "offset": 0.0, "sigma": 0.4}, "meg_block_args": {"node_embed": [64, 32, 32], "edge_embed": [64, 32, 32], "env_embed": [64, 32, 32], "activation": "kgcnn>softplus2"}, "set2set_args": {"channels": 16, "T": 3, "pooling_method": "sum", "init_qstar": "0"}, "node_ff_args": {"units": [64, 32], "activation": "kgcnn>softplus2"}, "edge_ff_args": {"units": [64, 32], "activation": "kgcnn>softplus2"}, "state_ff_args": {"units": [64, 32], "activation": "kgcnn>softplus2"}, "nblocks": 3, "has_ff": true, "dropout": null, "use_set2set": true, "verbose": 10, "output_embedding": "graph", "output_mlp": {"use_bias": [true, true, true], "units": [32, 16, 1], "activation": ["kgcnn>softplus2", "kgcnn>softplus2", "sigmoid"]}}}, "training": {"cross_validation": {"class_name": "KFold", "config": {"n_splits": 5, "random_state": 42, "shuffle": true}}, "fit": {"batch_size": 32, "epochs": 100, "validation_freq": 10, "verbose": 2, "callbacks": [{"class_name": "kgcnn>LinearLearningRateScheduler", "config": {"learning_rate_start": 0.0005, "learning_rate_stop": 5e-06, "epo_min": 100, "epo": 100, "verbose": 0}}]}, "compile": {"optimizer": {"class_name": "Adam", "config": {"learning_rate": 0.0005}}, "loss": "binary_crossentropy", "metrics": [{"class_name": "AUC", "config": {"name": "auc"}}, "binary_accuracy"]}, "multi_target_indices": null}, "data": {"data_unit": ""}, "info": {"postfix": "", "postfix_file": "", "kgcnn_version": "4.0.0"}, "dataset": {"class_name": "MatProjectIsMetalDataset", "module_name": "kgcnn.data.datasets.MatProjectIsMetalDataset", "config": {}, "methods": [{"map_list": {"method": "set_range_periodic", "max_distance": 5.0}}]}}
139 changes: 139 additions & 0 deletions training/results/QM9Dataset/PAiNN/PAiNN_QM9Dataset_score_G.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
OS: posix_linux
backend: tensorflow
cuda_available: 'True'
data_unit: '[''eV'']'
date_time: '2024-01-13 15:03:23'
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:
- 4
kgcnn_version: 4.0.0
loss:
- 0.0020833269227296114
- 0.0021870341151952744
- 0.0020268613006919622
- 0.002046447480097413
- 0.0020366490352898836
max_loss:
- 0.18058231472969055
- 0.18172824382781982
- 0.182379812002182
- 0.182345449924469
- 0.184342160820961
max_scaled_mean_absolute_error:
- 0.1981751173734665
- 0.19976872205734253
- 0.20042356848716736
- 0.20048657059669495
- 0.20278418064117432
max_scaled_root_mean_squared_error:
- 0.3366250693798065
- 0.3386140465736389
- 0.3401049077510834
- 0.34193339943885803
- 0.34167394042015076
max_val_loss:
- 0.03977010399103165
- 0.0406251922249794
- 0.036777835339307785
- 0.0481078140437603
- 0.03310152888298035
max_val_scaled_mean_absolute_error:
- 0.043530065566301346
- 0.04455344006419182
- 0.040288764983415604
- 0.05279850587248802
- 0.036348674446344376
max_val_scaled_root_mean_squared_error:
- 0.06623110175132751
- 0.07161669433116913
- 0.06692124903202057
- 0.07612305879592896
- 0.06383334845304489
min_loss:
- 0.0020833269227296114
- 0.0021570969838649035
- 0.0019992985762655735
- 0.002046447480097413
- 0.002029465977102518
min_scaled_mean_absolute_error:
- 0.002286263508722186
- 0.0023711547255516052
- 0.0021970325615257025
- 0.0022499929182231426
- 0.0022324800956994295
min_scaled_root_mean_squared_error:
- 0.0032772512640804052
- 0.0033559289295226336
- 0.0031445357017219067
- 0.0032447525300085545
- 0.003167299320921302
min_val_loss:
- 0.009831289760768414
- 0.009659633971750736
- 0.010057174600660801
- 0.009713026694953442
- 0.009950236417353153
min_val_scaled_mean_absolute_error:
- 0.010710245929658413
- 0.010544455610215664
- 0.0109587162733078
- 0.010611411184072495
- 0.010885369963943958
min_val_scaled_root_mean_squared_error:
- 0.02738744206726551
- 0.029041491448879242
- 0.0315713956952095
- 0.02654586173593998
- 0.0309130921959877
model_class: make_model
model_name: PAiNN
model_version: '2023-10-04'
multi_target_indices:
- 13
number_histories: 5
scaled_mean_absolute_error:
- 0.002286263508722186
- 0.002404132392257452
- 0.0022272958885878325
- 0.0022499929182231426
- 0.0022403455805033445
scaled_root_mean_squared_error:
- 0.0032772512640804052
- 0.0033922174479812384
- 0.003179130144417286
- 0.0032447525300085545
- 0.0031734260264784098
seed: 42
time_list:
- '15:29:50.416898'
- '15:09:43.459514'
- '16:17:11.065092'
- '15:03:24.594985'
- '15:23:00.575399'
val_loss:
- 0.010281895287334919
- 0.010296816937625408
- 0.010204370133578777
- 0.009713026694953442
- 0.009950236417353153
val_scaled_mean_absolute_error:
- 0.01120477169752121
- 0.011244174093008041
- 0.011120576411485672
- 0.010611411184072495
- 0.010885369963943958
val_scaled_root_mean_squared_error:
- 0.02816121280193329
- 0.029436415061354637
- 0.03214358165860176
- 0.026773963123559952
- 0.031325630843639374
1 change: 1 addition & 0 deletions training/results/QM9Dataset/PAiNN/PAiNN_hyper_G.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"model": {"class_name": "make_model", "module_name": "kgcnn.literature.PAiNN", "config": {"name": "PAiNN", "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}], "input_tensor_type": "ragged", "input_embedding": null, "equiv_initialize_kwargs": {"dim": 3, "method": "eps", "units": 128}, "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": null}, "update_args": {"units": 128, "add_eps": true}, "depth": 3, "verbose": 10, "output_embedding": "graph", "output_mlp": {"use_bias": [true, true], "units": [128, 1], "activation": ["swish", "linear"]}}}, "training": {"cross_validation": {"class_name": "KFold", "config": {"n_splits": 5, "random_state": 42, "shuffle": true}}, "fit": {"batch_size": 32, "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": 3000.0, "decay_steps": 4000000.0, "decay_rate": 0.01}}, "amsgrad": true, "use_ema": true}}, "loss": "mean_absolute_error"}, "scaler": {"class_name": "QMGraphLabelScaler", "config": {"atomic_number": "node_number", "scaler": [{"class_name": "ExtensiveMolecularScaler", "config": {}}]}}, "multi_target_indices": [13]}, "dataset": {"class_name": "QM9Dataset", "module_name": "kgcnn.data.datasets.QM9Dataset", "config": {}, "methods": [{"map_list": {"method": "set_range", "max_distance": 5, "max_neighbours": 10000}}]}, "data": {}, "info": {"postfix": "", "postfix_file": "_G", "kgcnn_version": "4.0.0"}}
Loading

0 comments on commit 9b43be6

Please sign in to comment.