Skip to content

fix InvalidArgumentError caused by zero sel and optimize zero matrix#900

Merged
amcadmus merged 3 commits intodeepmodeling:develfrom
njzjz:zero-sel
Jul 31, 2021
Merged

fix InvalidArgumentError caused by zero sel and optimize zero matrix#900
amcadmus merged 3 commits intodeepmodeling:develfrom
njzjz:zero-sel

Conversation

@njzjz
Copy link
Member

@njzjz njzjz commented Jul 29, 2021

Fix #899. See comments in the code for details.

Also optimize to directly return zero matrix for exclude_types. As everything is zero, calculate something like zero times a number is meaningless.

Fix deepmodeling#899. See comments in the code for details.
@njzjz njzjz linked an issue Jul 29, 2021 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2021

Codecov Report

Merging #900 (b9c212f) into devel (953621f) will increase coverage by 8.28%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel     #900      +/-   ##
==========================================
+ Coverage   73.86%   82.15%   +8.28%     
==========================================
  Files          85      118      +33     
  Lines        6808    10001    +3193     
==========================================
+ Hits         5029     8216    +3187     
- Misses       1779     1785       +6     
Impacted Files Coverage Δ
deepmd/descriptor/se_r.py 92.85% <33.33%> (ø)
deepmd/descriptor/se_a.py 97.56% <63.63%> (-1.37%) ⬇️
source/api_cc/tests/test_deepdipole.cc 100.00% <0.00%> (ø)
source/lib/tests/test_prod_virial_a.cc 100.00% <0.00%> (ø)
source/lib/tests/test_prod_virial_r.cc 100.00% <0.00%> (ø)
source/lib/tests/test_env_mat_a.cc 100.00% <0.00%> (ø)
source/lib/tests/test_prod_force_a.cc 100.00% <0.00%> (ø)
source/lib/tests/test_prod_virial_grad_a.cc 100.00% <0.00%> (ø)
source/api_cc/tests/test_deeppot_a.cc 100.00% <0.00%> (ø)
source/lib/tests/test_tabulate.cc 100.00% <0.00%> (ø)
... and 25 more

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 953621f...b9c212f. Read the comment docs.

@njzjz njzjz changed the title fix InvalidArgumentError caused by zero sel fix InvalidArgumentError caused by zero sel and optimize zero matrix Jul 29, 2021
@amcadmus amcadmus merged commit 70508a5 into deepmodeling:devel Jul 31, 2021
@njzjz njzjz deleted the zero-sel branch August 12, 2021 22:20
gzq942560379 pushed a commit to HPC-AI-Team/deepmd-kit that referenced this pull request Sep 2, 2021
…rix (deepmodeling#900)

* fix `InvalidArgumentError` caused by zero `sel`

Fix deepmodeling#899. See comments in the code for details.

* directly return zero matrix for exclude_types

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] InvalidArgumentError when using zero sel

3 participants