-
Notifications
You must be signed in to change notification settings - Fork 16
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
From v1json and To json and fix the support for NRL json #104
Conversation
QG-phy
commented
Mar 27, 2024
•
edited
Loading
edited
- fix the nnsk from reference to load model in JSON format. and support the v1 version JSON model.
- add and fix the function of to_json make the model can be saved to a JSON format.
- update and fix the support of loading NRL json model.
- update read NRL par data to dptbsk json v2 model.
… train the model.
@floatingCatty 你可以review 这部分代码了。 |
- read NRL par data to v2 json model for dptb-sk.
dptb/nn/nnsk.py
Outdated
|
||
assert 'version' in json_model, "The version of the model is not provided in the json model file." | ||
ckpt_version = json_model.get("version") | ||
if ckpt_version not in [1,2]: |
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.
或许version也可以放constant里?
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.
已经加入
# load hopping params | ||
for orbpair, skparam in hopping_param.items(): | ||
skparam = torch.tensor(skparam, dtype=dtype, device=device) | ||
skparam[0] *= 13.605662285137 * 2 | ||
if ene_unit == "Hartree" and hopping['method'] not in ['NRL', 'NRL1', 'NRL2']: |
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.
这边如果是NRL那不需要处理嘛
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.
nrl 的参数格式和我们其他的不一样。不能这么简单的用第0个乘一下。我对于NRL的json已经基于默认单位eV 处理完了。不需要在这里单独的处理。另外这个单位的转换现在是非常特有的情况才会用到,只有读取旧版的时候才有用。我们v2版本的json全部是单位强制为eV.