-
Notifications
You must be signed in to change notification settings - Fork 175
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
fix bug for sys_idx dependent trust level and add option for model_devi_job #786
Conversation
Sorry, document change not pushed. Would be updated later. |
"model_devi_dt": 0.002, | ||
"model_devi_skip": 0, | ||
"model_devi_f_trust_lo": [0.050, 0.050], | ||
"model_devi_f_trust_hi": {"1": 0.150, "0": 0.150}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand here - why not directly use an integer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make sure passing the original unit test. What only in need here is just to check whether the list
and dict
parser work and thus I made two examples. As a matter of fact, it should be refactored as normal usage, setting different values for each system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it seems that the level does not affect the test result. I would change it to different values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean why {"1": 0.150, "0": 0.150}
is not {1: 0.150, 0: 0.150}
... I don't see the reason to use a str
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, just in prevention of misleading, because most keys are string. Seems not to be so necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you are right. JSON only allows string as the key... (Python does not)
dpgen/generator/run.py
Outdated
if cur_job.get('model_devi_f_trust_lo'): | ||
f_trust_lo = cur_job.get('model_devi_f_trust_lo') | ||
else: | ||
f_trust_lo = jdata['model_devi_f_trust_lo'] | ||
if cur_job.get('model_devi_f_trust_hi'): | ||
f_trust_hi = cur_job.get('model_devi_f_trust_hi') | ||
else: | ||
f_trust_hi = jdata['model_devi_f_trust_hi'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not write it as
f_trust_lo = cur_job.get('model_devi_f_trust_lo', jdata['model_devi_f_trust_lo'])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If written like this, on the condition that trust level only supplied in each model_devi_job
, it might result in IndexError
because of the lack of global trust level. It would be confusing for user to set global trust level when local ones set.
* fix unexpected 0 bug * fix document not supporting typing bug * change value for trust level in unittest
The arguments deepmodeling#786 added should be optional.
The arguments #786 added should be optional.
As mentioned in #746, there is a bug in #609 due to not converting
str
indexes toint
ones. So the bug was fixed here. Also, the author of the issue mentioned that it would be more proper to select trust level for each iteration. So now, iteration dependent trust level for force and virial was supported. For example, just settingmodel_devi_f_trust_hi
inmodel_devi_jobs
:However, it might be difficult to adapt different trust level for
sys_idx
selected in each iteration. So now,dict
could be used to set the trust level in format like: