deepmd-kit
deepmd-kit copied to clipboard
DP Mask Model
I implement a DP Mask Model with self-defined se_a_mask
op and EnerForcesMaskLoss
.
The main contribution comes from two points.
- Add the argument for
mask_matrix.npy
(shape [num_frames, num_tot_atoms]), used in se_a_mask. User can specific on which atom is real or virtual. So that we can concatenate the frames which have different elements and atoms into one numpy file. - Add the argument
mask_matrix4force.npy
(shape [ num_frames, num_tot_atoms * 3 ]). Actually, this is a coefficient matrix which used in the moduleEnerForcesMaskLoss
. The forces losses on each atom will be multiplied by this matrix. User can specify the forces on which atom should be included in the training process. This would be benefit to the DP/MM hybrid potential.
Besides, I did implement DeepPotMaskModel
for running of se_a_mask
op in the C API interface. Integration of this model with OpenMM will be done in future.
atom_num4element.npy
and atom_num4frame.npy
are needed for loss normalization on each element and each frame in printing.
Codecov Report
Merging #1798 (f99c0f2) into devel (bfd40b7) will decrease coverage by
1.98%
. The diff coverage is17.62%
.
@@ Coverage Diff @@
## devel #1798 +/- ##
==========================================
- Coverage 77.06% 75.08% -1.99%
==========================================
Files 118 120 +2
Lines 9411 9722 +311
==========================================
+ Hits 7253 7300 +47
- Misses 2158 2422 +264
Impacted Files | Coverage Δ | |
---|---|---|
source/api_cc/include/DeepPot.h | 66.66% <ø> (ø) |
|
deepmd/loss/ener.py | 34.31% <3.80%> (-13.58%) |
:arrow_down: |
deepmd/descriptor/se_a_mask.py | 14.03% <14.03%> (ø) |
|
deepmd/train/trainer.py | 78.69% <55.55%> (-0.53%) |
:arrow_down: |
deepmd/model/ener.py | 87.02% <66.66%> (-1.78%) |
:arrow_down: |
source/op/_prod_force_se_a_mask_grad.py | 71.42% <71.42%> (ø) |
|
deepmd/descriptor/__init__.py | 100.00% <100.00%> (ø) |
|
deepmd/loss/__init__.py | 100.00% <100.00%> (ø) |
|
deepmd/utils/argcheck.py | 89.81% <100.00%> (+0.29%) |
:arrow_up: |
deepmd/common.py | 79.35% <0.00%> (-4.20%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update bfd40b7...f99c0f2. Read the comment docs.
Could you provide an unittest to ensure it can work?
Could you provide an unittest to ensure it can work?
Of course. But it may take a few days. Since I'm a little busy today......
Many works are required for the consistent of dp_mask and DP 2.x version. Refactor of dp_mask implementation is needed. I will post a new PR and unit test cases later.
Refactor of dp_mask implementation is needed.
@dingye18 @wanghan-iapcm @iProzd We can schedule a short meeting before refactoring.
Sure, @njzjz please help arranging the meeting, thanks!