Skip to content

Commit

Permalink
New FFs.
Browse files Browse the repository at this point in the history
  • Loading branch information
knc6 committed Dec 2, 2024
1 parent d28077f commit 40c22a2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
3 changes: 3 additions & 0 deletions alignn/ff/all_models_ff.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"v12.2.2024_dft_3d_307k": "https://figshare.com/ndownloader/files/50904240",
"v12.2.2024_mp_1.5mill": "https://figshare.com/ndownloader/files/50904783",
"v12.2.2024_mp_187k": "https://figshare.com/ndownloader/files/50904801",
"v10.30.2024_dft_3d_307k": "https://figshare.com/ndownloader/files/50634327",
"v10.30.2024_mp_168k": "https://figshare.com/ndownloader/files/50634318",
"v8.29.2024_dft_3d": "https://figshare.com/ndownloader/files/48889834",
Expand Down
24 changes: 10 additions & 14 deletions alignn/ff/ff.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,24 +127,25 @@ def get_figshare_model_ff(

def default_path():
"""Get default model path."""
dpath = get_figshare_model_ff(model_name="v5.27.2024")
dpath = get_figshare_model_ff(model_name="v12.2.2024_dft_3d_307k")
# dpath = get_figshare_model_ff(model_name="v5.27.2024")
# dpath = get_figshare_model_ff(model_name="v8.29.2024_dft_3d")
# dpath = get_figshare_model_ff(model_name="alignnff_wt10")
# dpath = get_figshare_model_ff(model_name="alignnff_fmult")
# print("model_path", dpath)
print("model_path", dpath)
return dpath


def mp_2mill():
"""Get defaukt model path."""
dpath = get_figshare_model_ff(model_name="revised")
"""Get default model path."""
dpath = get_figshare_model_ff(model_name="v12.2.2024_mp_1.5mill")
# print("model_path", dpath)
return dpath


def mp_167k():
"""Get default model path."""
dpath = get_figshare_model_ff(model_name="alignnff_fmult")
dpath = get_figshare_model_ff(model_name="v12.2.2024_mp_187k")
# print("model_path", dpath)
return dpath

Expand All @@ -156,13 +157,6 @@ def jv_307k():
return dpath


def jv_2mill():
"""Get model trained on mlearn path."""
dpath = get_figshare_model_ff(model_name="fmult_mlearn_only")
# print("model_path", dpath)
return dpath


def wt01_path():
"""Get defaukt model path."""
dpath = get_figshare_model_ff(model_name="alignnff_wt01")
Expand Down Expand Up @@ -216,15 +210,15 @@ def __init__(
device=None,
model=None,
config=None,
path=".",
path=None,
model_filename="best_model.pt",
config_filename="config.json",
output_dir=None,
batch_stress=True,
force_mult_natoms=False,
force_mult_batchsize=True,
force_multiplier=1,
stress_wt=0.1,
stress_wt=0.05,
):
"""Initialize class."""
super(AlignnAtomwiseCalculator, self).__init__(
Expand All @@ -239,6 +233,8 @@ def __init__(
self.force_mult_natoms = force_mult_natoms
self.force_mult_batchsize = force_mult_batchsize
self.force_multiplier = force_multiplier
if path is None and model is None:
path = default_path()
if self.config is None:
config = loadjson(os.path.join(path, config_filename))
self.config = config
Expand Down
2 changes: 1 addition & 1 deletion alignn/tests/test_prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def test_calculator():
energy = ase_atoms.get_potential_energy()
forces = ase_atoms.get_forces()
stress = ase_atoms.get_stress()
print("round(energy,3)", round(energy, 3))
print("energy", energy)
print("max(forces.flatten()),3)", max(forces.flatten()))
print("max(stress.flatten()),3)", max(stress.flatten()))
# assert round(energy,3)==round(-60.954999923706055,3)
Expand Down

0 comments on commit 40c22a2

Please sign in to comment.