Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Support for model type "linear_ener" and other similar models #1666

Closed
draneyj opened this issue Nov 11, 2024 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@draneyj
Copy link

draneyj commented Nov 11, 2024

Summary

When using model type "linear_ener" with DPGEN there is an error, since the model type does not have a "descriptor" field. This prevents the use of this model type with DPGEN.

Detailed Description

Here is the "default_training_param" field in my param.json file

"default_training_param": {
    "model": {
		"type": "linear_ener",
		"weights": "sum",
		"models": [
			{
				"type_map":	["C", "H"],
				"descriptor" :{
					"type":		"se_e2_a",
					"sel":		[128, 128],
					"rcut_smth":	0.50,
					"rcut":		    5.0,
					"neuron":		[25, 50, 100],
					"resnet_dt":	false,
					"axis_neuron":	16,
					"seed":		11111,
					"_comment":		" that's all"
				},
				"fitting_net" : {
					"neuron":		[120, 120, 120],
					"resnet_dt":	false,
					"seed":		11111,
					"_comment":		" that's all"
				}
			},
			{
				"type": "pairtab",
				"tab_file": "/scratch/gpfs/jd6157/dp_data/tabulation/tab2.txt",
				"rcut": 2.0,
				"sel": [64]
			}
        ]
	},
    "learning_rate": {
        "start_lr": 0.0002,
        "decay_steps": 5000
    },
    "loss": {
        "start_pref_e": 0.02,
        "limit_pref_e": 8,
        "start_pref_f": 1000,
        "limit_pref_f": 1,
        "start_pref_v": 0.0,
        "limit_pref_v": 0.0
    },
    "training": {
        "set_prefix": "set",
        "stop_batch": 1000000,
        "batch_size": 1,
        "disp_file": "lcurve.out",
        "disp_freq": 2000,
        "numb_test": 5,
        "save_freq": 400000,
        "save_ckpt": "model.ckpt",
        "disp_training": true,
        "time_training": true,
        "profiling": false,
        "profiling_file": "timeline.json",
        "_comment": "that's all"
    }
  },

and the resulting error / trace:

Traceback (most recent call last):
File "/scratch/gpfs/AZP/software/shared-conda/deepmd/bin/dpgen", line 10, in
sys.exit(main())
^^^^^^
File "/scratch/gpfs/AZP/software/shared-conda/deepmd/lib/python3.12/site-packages/dpgen/main.py", line 255, in main
args.func(args)
File "/scratch/gpfs/AZP/software/shared-conda/deepmd/lib/python3.12/site-packages/dpgen/generator/run.py", line 5394, in gen_run
run_iter(args.PARAM, args.MACHINE)
File "/scratch/gpfs/AZP/software/shared-conda/deepmd/lib/python3.12/site-packages/dpgen/generator/run.py", line 4722, in run_iter
make_train(ii, jdata, mdata)
File "/scratch/gpfs/AZP/software/shared-conda/deepmd/lib/python3.12/site-packages/dpgen/generator/run.py", line 559, in make_train
if jinput["model"]["descriptor"]["type"] == "hybrid":
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'descriptor'

Further Information, Files, and Links

No response

@draneyj draneyj added the enhancement New feature or request label Nov 11, 2024
@draneyj
Copy link
Author

draneyj commented Nov 11, 2024

Forgot to mention this is with dpgen version 0.12.1

@njzjz
Copy link
Member

njzjz commented Nov 11, 2024

I think this has been fixed by #1584

@draneyj
Copy link
Author

draneyj commented Nov 11, 2024

Indeed it has. Thank you very much.

@draneyj draneyj closed this as completed Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants