deepmd-kit icon indicating copy to clipboard operation
deepmd-kit copied to clipboard

Feat : pt: support property fitting

Open Chengqian-Zhang opened this issue 1 year ago • 7 comments

Support property fitting:

One can fit multiple scalar properties at the same time (application scenario: predicting homo, lumo, bandgap of a structure at the same time), the number of properties to be fitted is determined by the "task_num" keyword in "model/fitting". Of course, it is possible to fit only 1 scalar property (same as energy).

But at the moment, it only supports averaging atomic_property to get the final property, and it doesn't add bias to each element type (different from energy), more comprehensive functions will be realized in the future pr.

You'll notice that I've also modified some parts of denoise, but due to the complexity of denoise fitting and the unfinished refactoring of the loss part @iProzd , the denoise functionality has not been fully implemented in this pr.

Chengqian-Zhang avatar Mar 18 '24 16:03 Chengqian-Zhang

Codecov Report

Attention: Patch coverage is 75.00000% with 47 lines in your changes missing coverage. Please review.

Project coverage is 77.66%. Comparing base (dc14719) to head (34ea4d8). Report is 255 commits behind head on devel.

Files Patch % Lines
deepmd/pt/loss/property.py 27.08% 35 Missing :warning:
deepmd/pt/train/training.py 0.00% 4 Missing :warning:
deepmd/dpmodel/fitting/property_fitting.py 92.85% 2 Missing :warning:
deepmd/infer/deep_property.py 90.90% 2 Missing :warning:
deepmd/pt/infer/deep_eval.py 33.33% 2 Missing :warning:
deepmd/pt/model/model/dp_model.py 75.00% 1 Missing :warning:
deepmd/pt/model/task/property.py 96.96% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3488      +/-   ##
==========================================
- Coverage   77.68%   77.66%   -0.02%     
==========================================
  Files         432      437       +5     
  Lines       37335    37523     +188     
  Branches     1620     1620              
==========================================
+ Hits        29002    29143     +141     
- Misses       7472     7519      +47     
  Partials      861      861              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 18 '24 16:03 codecov[bot]

@wanghan-iapcm Seemly I do not have the necessary permissions to add reviewers to a pull request in the repository. Can you give me higher access? Rjiexf3OdW

Chengqian-Zhang avatar Mar 19 '24 07:03 Chengqian-Zhang

@wanghan-iapcm I have delete all denoise content.

Chengqian-Zhang avatar Mar 19 '24 14:03 Chengqian-Zhang

I think dptest also needs to be implemented in this PR?

Chengqian-Zhang avatar Mar 20 '24 16:03 Chengqian-Zhang

the output stat should be replace by the change_out_bias method provided in #3480

wanghan-iapcm avatar Mar 21 '24 06:03 wanghan-iapcm

#3480 is merging @Chengqian-Zhang please update the pr accordingly.

wanghan-iapcm avatar Mar 22 '24 09:03 wanghan-iapcm

@wanghan-iapcm Copy that, I will update immediately.

Chengqian-Zhang avatar Mar 22 '24 09:03 Chengqian-Zhang

I will complete this function in another PR #3867

Chengqian-Zhang avatar Aug 27 '24 18:08 Chengqian-Zhang