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
model_devi | sort models in default&support user-defined order #610
Conversation
current behavior: 1)the list of models written in input.lammps for model_devi is created by "glob" without "sort" --> may give different (random) orders in different machine environments --> would randomly alter the model being used to sample configurations (always use the first model written in imput.lammps) ---> could lead to unexpected performance, such as, when using together with "model_devi_activation_func" that allows four models to be nonequivalent. 2)when preparing input.lammps from iuser-provided template, the line begin with "pair_style deepmd" will be overwritten by dpgen, thus overwrites the user defined order of models ---> could lead to unexpected performance, such as, when using together with "model_devi_activation_func" that allows four models to be nonequivalent and users indeed expected a specific order of models. changes: 1)sorted the list of models in default, thus always use graph.000.pb to sample configurations; 2)check weather user writes the full line of begin with "pair_style deepmd" (by checking the length), if yes, leave it be; if not, overwrites with the default settings (use graph.000.pb to sample); besides, the original error trigger is retained if key words "pair_style deepmd" are not provided in the template.
Codecov Report
@@ Coverage Diff @@
## devel #610 +/- ##
==========================================
+ Coverage 33.14% 33.16% +0.02%
==========================================
Files 86 86
Lines 14826 14837 +11
==========================================
+ Hits 4914 4921 +7
- Misses 9912 9916 +4
Continue to review full report at Codecov.
|
Could you please upload or update the examples for revmat-mode? Thanks! |
will be uploaded afterwards |
There can be any number of space between "pair_style" and "deepmd", so the length check may fail. |
Sorry for the misleading description of the pr. It actually checks the 【numbers of non-space words in the line】 by 【.split()】,
The description of this pr is correspondingly revised. |
current behavior:
1)the list of models written in input.lammps for model_devi is created by "glob" without "sort" --> may give different (random) orders in different machine environments --> would randomly alter the model being used to sample configurations (always use the first model written in imput.lammps)
---> could lead to unexpected performance, such as, when using together with "model_devi_activation_func" that allows four models to be nonequivalent.
2)when preparing input.lammps from iuser-provided template, the line begin with "pair_style deepmd" will be overwritten by dpgen, thus overwrites the user defined order of models ---> could lead to unexpected performance, such as, when using together with "model_devi_activation_func" that allows four models to be nonequivalent and users indeed expected a specific order of models.
changes:
1)sorted the list of models in default, thus always use graph.000.pb to sample configurations;
2)check weather user writes the full line of begin with "pair_style deepmd" (by checking the number of non-space words in this line), if yes, leave it be; if not, overwrites with the default settings (use graph.000.pb to sample); besides, the original error trigger is retained if key words "pair_style deepmd" are not provided in the template.