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

add dp_train_skip_neighbor_stat argument #1179

Merged
merged 1 commit into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions dpgen/generator/arginfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def training_args() -> List[Argument]:
doc_training_iter0_model_path = "The model used to init the first iter training. Number of element should be equal to numb_models."
doc_training_init_model = "Iteration > 0, the model parameters will be initilized from the model trained at the previous iteration. Iteration == 0, the model parameters will be initialized from training_iter0_model_path."
doc_default_training_param = "Training parameters for deepmd-kit in 00.train. You can find instructions from here: (https://github.com/deepmodeling/deepmd-kit)."
doc_dp_train_skip_neighbor_stat = "Append --skip-neighbor-stat flag to dp train."
doc_dp_compress = "Use dp compress to compress the model."
doc_training_reuse_iter = "The minimal index of iteration that continues training models from old models of last iteration."
doc_reusing = " This option is only adopted when continuing training models from old models. This option will override default parameters."
Expand Down Expand Up @@ -112,6 +113,13 @@ def training_args() -> List[Argument]:
optional=False,
doc=doc_default_training_param,
),
Argument(
"dp_train_skip_neighbor_stat",
bool,
optional=True,
default=False,
doc=doc_dp_train_skip_neighbor_stat,
),
Argument(
"dp_compress", bool, optional=True, default=False, doc=doc_dp_compress
),
Expand Down
5 changes: 4 additions & 1 deletion dpgen/generator/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,10 @@ def run_train(iter_index, jdata, mdata):
## Commands are like `dp train` and `dp freeze`
## train_command should not be None
assert train_command
command = "%s train %s" % (train_command, train_input_file)
extra_flags = ""
if jdata.get("dp_train_skip_neighbor_stat", False):
extra_flags += " --skip-neighbor-stat"
command = "%s train %s%s" % (train_command, train_input_file, extra_flags)
if training_init_model:
command = (
"{ if [ ! -f model.ckpt.index ]; then %s --init-model old/model.ckpt; else %s --restart model.ckpt; fi }"
Expand Down