diff --git a/deepmd/pt/model/model/__init__.py b/deepmd/pt/model/model/__init__.py index 3f0b691d59..7c6306264a 100644 --- a/deepmd/pt/model/model/__init__.py +++ b/deepmd/pt/model/model/__init__.py @@ -99,7 +99,9 @@ def get_zbl_model(model_params): if "ener" in fitting_net["type"]: fitting_net["return_energy"] = True fitting = BaseFitting(**fitting_net) - dp_model = DPAtomicModel(descriptor, fitting, type_map=model_params["type_map"]["dp"]) + dp_model = DPAtomicModel( + descriptor, fitting, type_map=model_params["type_map"]["dp"] + ) # pairtab filepath = model_params["use_srtab"] pt_model = PairTabAtomicModel( diff --git a/examples/water/zbl/input_torch.json b/examples/water/zbl/input_torch.json index 2f2291c617..a01c5f8f0b 100644 --- a/examples/water/zbl/input_torch.json +++ b/examples/water/zbl/input_torch.json @@ -1,94 +1,102 @@ { - "_comment1": " model parameters", - "model": { - "use_srtab": "H2O_tab_potential.txt", - "smin_alpha": 0.1, - "sw_rmin": 0.8, - "sw_rmax": 1.0, - "type_map": { - "pairtab":["O","H"], - "dp": ["O", "H"], - "zbl": ["O", "H"] - }, - "descriptor": { - "type": "se_e2_a", - "sel": [ - 46, - 92 - ], - "rcut_smth": 0.50, - "rcut": 6.00, - "neuron": [ - 25, - 50, - 100 - ], - "resnet_dt": false, - "axis_neuron": 16, - "type_one_side": true, - "precision": "float64", - "seed": 1, - "_comment2": " that's all" - }, - "fitting_net": { - "neuron": [ - 240, - 240, - 240 - ], - "resnet_dt": true, - "precision": "float64", - "seed": 1, - "_comment3": " that's all" - }, - "_comment4": " that's all" + "_comment1": " model parameters", + "model": { + "use_srtab": "H2O_tab_potential.txt", + "smin_alpha": 0.1, + "sw_rmin": 0.8, + "sw_rmax": 1.0, + "type_map": { + "pairtab": [ + "O", + "H" + ], + "dp": [ + "O", + "H" + ], + "zbl": [ + "O", + "H" + ] }, - - "learning_rate": { - "type": "exp", - "decay_steps": 5000, - "start_lr": 0.001, - "stop_lr": 3.51e-8, - "_comment5": "that's all" + "descriptor": { + "type": "se_e2_a", + "sel": [ + 46, + 92 + ], + "rcut_smth": 0.50, + "rcut": 6.00, + "neuron": [ + 25, + 50, + 100 + ], + "resnet_dt": false, + "axis_neuron": 16, + "type_one_side": true, + "precision": "float64", + "seed": 1, + "_comment2": " that's all" }, - - "loss": { - "type": "ener", - "start_pref_e": 0.02, - "limit_pref_e": 1, - "start_pref_f": 1000, - "limit_pref_f": 1, - "start_pref_v": 0, - "limit_pref_v": 0, - "_comment6": " that's all" + "fitting_net": { + "neuron": [ + 240, + 240, + 240 + ], + "resnet_dt": true, + "precision": "float64", + "seed": 1, + "_comment3": " that's all" }, - - "training": { - "training_data": { - "systems": [ - "../data/data_0/", - "../data/data_1/", - "../data/data_2/" - ], - "batch_size": "auto", - "_comment7": "that's all" - }, - "validation_data": { - "systems": [ - "../data/data_3" - ], - "batch_size": 1, - "numb_btch": 3, - "_comment8": "that's all" - }, - "numb_steps": 1000000, - "seed": 10, - "disp_file": "lcurve.out", - "disp_freq": 100, - "save_freq": 1000, - "_comment9": "that's all" + "_comment4": " that's all" + }, + + "learning_rate": { + "type": "exp", + "decay_steps": 5000, + "start_lr": 0.001, + "stop_lr": 3.51e-8, + "_comment5": "that's all" + }, + + "loss": { + "type": "ener", + "start_pref_e": 0.02, + "limit_pref_e": 1, + "start_pref_f": 1000, + "limit_pref_f": 1, + "start_pref_v": 0, + "limit_pref_v": 0, + "_comment6": " that's all" + }, + + "training": { + "training_data": { + "systems": [ + "../data/data_0/", + "../data/data_1/", + "../data/data_2/" + ], + "batch_size": "auto", + "_comment7": "that's all" }, - - "_comment10": "that's all" - } - \ No newline at end of file + "validation_data": { + "systems": [ + "../data/data_3" + ], + "batch_size": 1, + "numb_btch": 3, + "_comment8": "that's all" + }, + "numb_steps": 1000000, + "seed": 10, + "disp_file": "lcurve.out", + "disp_freq": 100, + "save_freq": 1000, + "_comment9": "that's all" + }, + + "_comment10": "that's all" +} diff --git a/source/tests/pt/model/water/zbl.json b/source/tests/pt/model/water/zbl.json index 6258bba195..a01c5f8f0b 100644 --- a/source/tests/pt/model/water/zbl.json +++ b/source/tests/pt/model/water/zbl.json @@ -6,9 +6,18 @@ "sw_rmin": 0.8, "sw_rmax": 1.0, "type_map": { - "pairtab":["O","H"], - "dp": ["O", "H"], - "zbl": ["O", "H"] + "pairtab": [ + "O", + "H" + ], + "dp": [ + "O", + "H" + ], + "zbl": [ + "O", + "H" + ] }, "descriptor": { "type": "se_e2_a",