Skip to content

support the DOS (electronic density of states) fitting#2449

Merged
wanghan-iapcm merged 46 commits intodeepmodeling:develfrom
mingzhong15:devel
Apr 15, 2023
Merged

support the DOS (electronic density of states) fitting#2449
wanghan-iapcm merged 46 commits intodeepmodeling:develfrom
mingzhong15:devel

Conversation

@mingzhong15
Copy link
Contributor

here i present the implementation of DeepDOS model [Phys. Rev. B 105, 174109 (2022)] in dpkit-devel branch

generally, i add a new fitting_type = 'dos' to allow the DP to fit a vector. this vector can be global (dos.raw/npy) or atomic (atom_dos.raw/npy), whose length is numb_dos.

specifically,

  1. fit/dos.py, loss/dos.py, model/dos.py and infer/deep_dos.py is created to allow fitting and inference
  2. relevant */__init__.py, train/trainer.py, utils/argcheck.py is updated
  3. in entrypoint/freeze.py, entrypoint/test.py , relevant functions are added to freeze and test the DeepDOS model
  4. a simple user guide is added in the doc/model/train-fitting-dos.md
  5. an example is provide in the examples/dos/, the input script is provided in the examples/dos/train/input.json, data sets are provided in the examples/dos/data/

mingzhong15 and others added 27 commits May 4, 2022 12:40
This reverts commit e3917fc.
add definition for make_compute_fparam & make_ttm_fparam
now we can use `compute temp` or `fix ttm` to update the fparam each MD step
now we can use `compute temp` or `fix ttm` to update the fparam each MD step
…. function name `make_compute_fparam` is changed to `make_fparam_from_compute`
support fitting electronic density of states (DOS)
add example and basic doc to hands on the deepdos fitting
@codecov
Copy link

codecov bot commented Apr 9, 2023

Codecov Report

Patch coverage: 46.22% and project coverage change: -0.83 ⚠️

Comparison is base (8c685e2) 75.19% compared to head (f284e1c) 74.37%.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #2449      +/-   ##
==========================================
- Coverage   75.19%   74.37%   -0.83%     
==========================================
  Files         223      227       +4     
  Lines       22691    23378     +687     
  Branches     1673     1673              
==========================================
+ Hits        17063    17387     +324     
- Misses       4535     4895     +360     
- Partials     1093     1096       +3     
Impacted Files Coverage Δ
deepmd/entrypoints/test.py 8.51% <2.77%> (-1.69%) ⬇️
deepmd/loss/dos.py 9.18% <9.18%> (ø)
deepmd/train/trainer.py 81.83% <40.00%> (-0.66%) ⬇️
deepmd/fit/dos.py 47.34% <47.34%> (ø)
deepmd/entrypoints/freeze.py 59.17% <50.00%> (-0.11%) ⬇️
deepmd/infer/__init__.py 79.31% <66.66%> (-1.46%) ⬇️
deepmd/infer/deep_dos.py 67.74% <67.74%> (ø)
deepmd/model/dos.py 69.23% <69.23%> (ø)
deepmd/fit/__init__.py 100.00% <100.00%> (ø)
deepmd/loss/__init__.py 100.00% <100.00%> (ø)
... and 2 more

... and 3 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@njzjz
Copy link
Member

njzjz commented Apr 9, 2023

pre-commit.ci autofix

Copy link
Collaborator

@wanghan-iapcm wanghan-iapcm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please add UTs for your contributions. Thanks!
  2. The data in the example are for the demonstrative purposes. Currently they are too large (~600KB) to be included in the source code. Please reduce the size of the data.

@mingzhong15
Copy link
Contributor Author

thank you for the advice, i will revise the code. Also, i will add unit tests

mingzhong15 and others added 10 commits April 11, 2023 19:39
remove `ener_min` and `ener_max`, and improve some code
test inference of dos for single frame
check the output shape and value of `dos` and `atom_dos`
if atomic is True, the output of `dos` should be the sum of `atom_dos`
@njzjz
Copy link
Member

njzjz commented Apr 12, 2023

Patch coverage: 27.76% and project coverage change: -1.59 ⚠️

Please note that only 27.76% of the new codes have been tested.

Copy link
Member

@njzjz njzjz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wanghan-iapcm is it ok to merge? Indeed there are still some codes that are not covered.

@wanghan-iapcm wanghan-iapcm merged commit 0f61192 into deepmodeling:devel Apr 15, 2023
@wanghan-iapcm
Copy link
Collaborator

@wanghan-iapcm is it ok to merge? Indeed there are still some codes that are not covered.

sry i did not notice your comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants