Skip to content

Commit

Permalink
Merge pull request #125 from usnistgov/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
knc6 committed Jul 10, 2023
2 parents 598d5b6 + 3e4943a commit 7d21422
Show file tree
Hide file tree
Showing 25 changed files with 1,153 additions and 119 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ A basic web-app is for direct-prediction available at [JARVIS-ALIGNN app](https:
ALIGNN-FF
-------------------------

[ASE calculator](https://wiki.fysik.dtu.dk/ase/ase/calculators/calculators.html) provides interface to various codes. An example for ALIGNN-FF is give below:
[ASE calculator](https://wiki.fysik.dtu.dk/ase/ase/calculators/calculators.html) provides interface to various codes. An example for ALIGNN-FF is give below. Note that there are multiple pretrained ALIGNN-FF models available, here we use the deafult_path model. As more accurate models are developed, they will be made available as well:

```
from alignn.ff.ff import AlignnAtomwiseCalculator,default_path
Expand Down Expand Up @@ -224,7 +224,7 @@ plt.show()

To train ALIGNN-FF use `train_folder_ff.py` script which uses `atomwise_alignn` model:

AtomWise prediction example which looks for similar setup as before but unstead of `id_prop.csv`, it requires `id_prop.json` file (see example in the sample_data_ff directory).:
AtomWise prediction example which looks for similar setup as before but unstead of `id_prop.csv`, it requires `id_prop.json` file (see example in the sample_data_ff directory). Note ALIGNN-FF requires energy stored as energy per atom:

```
train_folder_ff.py --root_dir "alignn/examples/sample_data_ff" --config "alignn/examples/sample_data_ff/config_example_atomwise.json" --output_dir=temp
Expand Down
2 changes: 1 addition & 1 deletion alignn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Version number."""
__version__ = "2023.06.20"
__version__ = "2023.07.01"
1 change: 1 addition & 0 deletions alignn/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ class TrainingConfig(BaseSettings):
keep_data_order: bool = True
normalize_graph_level_loss: bool = False
distributed: bool = False
data_parallel: bool = False
n_early_stopping: Optional[int] = None # typically 50
output_dir: str = os.path.abspath(".") # typically 50
# alignn_layers: int = 4
Expand Down
7 changes: 4 additions & 3 deletions alignn/examples/sample_data_ff/config_example_atomwise.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,19 @@
"num_workers": 0,
"cutoff": 8.0,
"max_neighbors": 12,
"keep_data_order": false,
"keep_data_order": true,
"distributed":true,
"model": {
"name": "alignn_atomwise",
"atom_input_features": 92,
"calculate_gradient":true,
"atomwise_output_features":3,
"atomwise_output_features":0,
"alignn_layers":4,
"gcn_layers":4,
"output_features": 1,
"graphwise_weight":0.85,
"gradwise_weight":0.05,
"atomwise_weight":0.05,
"atomwise_weight":0.0,
"stresswise_weight":0.05

}
Expand Down
9 changes: 5 additions & 4 deletions alignn/examples/sample_data_ff/mlearn_data/Cu/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,28 @@
"use_canonize": false,
"num_workers": 0,
"cutoff": 8.0,
"max_neighbors": 12,
"max_neighbors": 13,
"keep_data_order": true,
"normalize_graph_level_loss": false,
"distributed": false,
"n_early_stopping": null,
"output_dir": "./",
"model": {
"name": "alignn_atomwise",
"alignn_layers": 4,
"alignn_layers": 2,
"gcn_layers": 4,
"atom_input_features": 92,
"edge_input_features": 80,
"triplet_input_features": 40,
"embedding_features": 64,
"embedding_features": 164,
"hidden_features": 256,
"output_features": 1,
"force_mult_natoms": true,
"grad_multiplier": -1,
"calculate_gradient": true,
"atomwise_output_features": 0,
"graphwise_weight": 1.0,
"gradwise_weight": 10.0,
"gradwise_weight": 50.00,
"stresswise_weight": 0.0,
"atomwise_weight": 0.0,
"link": "identity",
Expand Down
1 change: 1 addition & 0 deletions alignn/examples/sample_data_ff/mlearn_data/Ge/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"stresswise_weight": 0.0,
"atomwise_weight": 0.0,
"link": "identity",
"force_mult_natoms": true,
"zero_inflated": false,
"classification": false
}
Expand Down
1 change: 1 addition & 0 deletions alignn/examples/sample_data_ff/mlearn_data/Li/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"graphwise_weight": 1.0,
"gradwise_weight": 10.0,
"stresswise_weight": 0.0,
"force_mult_natoms": true,
"atomwise_weight": 0.0,
"link": "identity",
"zero_inflated": false,
Expand Down
1 change: 1 addition & 0 deletions alignn/examples/sample_data_ff/mlearn_data/Mo/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"atomwise_weight": 0.0,
"link": "identity",
"zero_inflated": false,
"force_mult_natoms": true,
"classification": false
}
}
3 changes: 2 additions & 1 deletion alignn/examples/sample_data_ff/mlearn_data/Ni/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@
"hidden_features": 256,
"output_features": 1,
"grad_multiplier": -1,
"force_mult_natoms": true,
"calculate_gradient": true,
"atomwise_output_features": 0,
"graphwise_weight": 1.0,
"gradwise_weight": 10.0,
"gradwise_weight": 1.0,
"stresswise_weight": 0.0,
"atomwise_weight": 0.0,
"link": "identity",
Expand Down
3 changes: 2 additions & 1 deletion alignn/examples/sample_data_ff/mlearn_data/Si/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@
"calculate_gradient": true,
"atomwise_output_features": 0,
"graphwise_weight": 1.0,
"gradwise_weight": 10.0,
"gradwise_weight": 1.0,
"stresswise_weight": 0.0,
"atomwise_weight": 0.0,
"force_mult_natoms": true,
"link": "identity",
"zero_inflated": false,
"classification": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,17 @@
"hidden_features": 256,
"output_features": 1,
"grad_multiplier": -1,
"force_mult_natoms": true,
"calculate_gradient": true,
"atomwise_output_features": 0,
"graphwise_weight": 1.0,
"gradwise_weight": 1.0,
"stresswise_weight": 0.01,
"gradwise_weight": 50.0,
"stresswise_weight": 0.0,
"atomwise_weight": 0.0,
"link": "identity",
"zero_inflated": false,
"use_cutoff_function": true,
"energy_mult_natoms": true,
"energy_mult_natoms": false,
"classification": false,
"stress_multiplier":1
}
Expand Down
Binary file added alignn/ff/alignnff_fd/best_model.pt
Binary file not shown.
71 changes: 71 additions & 0 deletions alignn/ff/alignnff_fd/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"version": "112bbedebdaecf59fb18e11c929080fb2f358246",
"dataset": "user_data",
"target": "target",
"atom_features": "cgcnn",
"neighbor_strategy": "k-nearest",
"id_tag": "jid",
"random_seed": 123,
"classification_threshold": null,
"n_val": null,
"n_test": null,
"n_train": null,
"train_ratio": 0.98,
"val_ratio": 0.01,
"test_ratio": 0.01,
"target_multiplication_factor": null,
"epochs": 50,
"batch_size": 10,
"weight_decay": 1e-05,
"learning_rate": 0.001,
"filename": "sample",
"warmup_steps": 2000,
"criterion": "l1",
"optimizer": "adamw",
"scheduler": "onecycle",
"pin_memory": false,
"save_dataloader": false,
"write_checkpoint": true,
"write_predictions": true,
"store_outputs": false,
"progress": true,
"log_tensorboard": false,
"standard_scalar_and_pca": false,
"use_canonize": false,
"num_workers": 0,
"cutoff": 8.0,
"max_neighbors": 12,
"keep_data_order": true,
"normalize_graph_level_loss": false,
"distributed": false,
"n_early_stopping": null,
"output_dir": "temp_new",
"model": {
"name": "alignn_atomwise",
"alignn_layers": 4,
"gcn_layers": 4,
"atom_input_features": 92,
"edge_input_features": 80,
"triplet_input_features": 40,
"embedding_features": 64,
"hidden_features": 256,
"output_features": 1,
"grad_multiplier": -1,
"calculate_gradient": true,
"atomwise_output_features": 0,
"graphwise_weight": 1.0,
"gradwise_weight": 10.0,
"stresswise_weight": 0.0,
"atomwise_weight": 0.0,
"link": "identity",
"zero_inflated": false,
"classification": false,
"force_mult_natoms": true,
"energy_mult_natoms": false,
"include_pos_deriv": false,
"use_cutoff_function": false,
"inner_cutoff": 6.0,
"stress_multiplier": 1.0,
"add_reverse_forces": false
}
}
Binary file added alignn/ff/alignnff_fmult/best_model.pt
Binary file not shown.
72 changes: 72 additions & 0 deletions alignn/ff/alignnff_fmult/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"version": "112bbedebdaecf59fb18e11c929080fb2f358246",
"dataset": "user_data",
"target": "target",
"atom_features": "cgcnn",
"neighbor_strategy": "k-nearest",
"id_tag": "jid",
"random_seed": 123,
"classification_threshold": null,
"n_val": null,
"n_test": null,
"n_train": null,
"train_ratio": 0.9,
"val_ratio": 0.05,
"test_ratio": 0.05,
"target_multiplication_factor": null,
"epochs": 300,
"batch_size": 16,
"weight_decay": 1e-05,
"learning_rate": 0.001,
"filename": "sample",
"warmup_steps": 2000,
"criterion": "l1",
"optimizer": "adamw",
"scheduler": "onecycle",
"pin_memory": false,
"save_dataloader": false,
"write_checkpoint": true,
"write_predictions": true,
"store_outputs": false,
"progress": true,
"log_tensorboard": false,
"standard_scalar_and_pca": false,
"use_canonize": false,
"num_workers": 0,
"cutoff": 8.0,
"max_neighbors": 12,
"keep_data_order": false,
"normalize_graph_level_loss": false,
"distributed": false,
"data_parallel": false,
"n_early_stopping": null,
"output_dir": "temp_new",
"model": {
"name": "alignn_atomwise",
"alignn_layers": 2,
"gcn_layers": 4,
"atom_input_features": 92,
"edge_input_features": 80,
"triplet_input_features": 40,
"embedding_features": 64,
"hidden_features": 256,
"output_features": 1,
"grad_multiplier": -1,
"calculate_gradient": true,
"atomwise_output_features": 0,
"graphwise_weight": 0.8,
"gradwise_weight": 0.2,
"stresswise_weight": 0.0,
"atomwise_weight": 0.0,
"link": "identity",
"zero_inflated": false,
"classification": false,
"force_mult_natoms": true,
"energy_mult_natoms": false,
"include_pos_deriv": false,
"use_cutoff_function": false,
"inner_cutoff": 6.0,
"stress_multiplier": 1.0,
"add_reverse_forces": false
}
}

0 comments on commit 7d21422

Please sign in to comment.