-
Notifications
You must be signed in to change notification settings - Fork 523
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
Support DPSpin for AtomicModel #3301
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #3301 +/- ##
==========================================
+ Coverage 76.97% 77.04% +0.06%
==========================================
Files 423 394 -29
Lines 35950 31948 -4002
Branches 1620 909 -711
==========================================
- Hits 27674 24613 -3061
+ Misses 7408 6807 -601
+ Partials 868 528 -340 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Duo <[email protected]>
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.
- UT for all the spin implementations.
env_protection
should be added to dpmodel- UT for
env_protection
. - the implementation of the dpmodel is not consistent with the pt side.
pref_e = self.limit_pref_e + (self.start_pref_e - self.limit_pref_e) * coef | ||
pref_fr = self.limit_pref_fr + (self.start_pref_fr - self.limit_pref_fr) * coef | ||
pref_fm = self.limit_pref_fm + (self.start_pref_fm - self.limit_pref_fm) * coef | ||
pref_v = self.limit_pref_v + (self.start_pref_v - self.limit_pref_v) * coef |
Check notice
Code scanning / CodeQL
Unused local variable Note
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.
I see
Signed-off-by: Duo <[email protected]>
for more information, see https://pre-commit.ci
|
||
class SpinTest(unittest.TestCase): | ||
def setUp(self): | ||
type_map_1 = ["H", "O"] |
Check notice
Code scanning / CodeQL
Unused local variable Note test
self.use_spin_1 = [False, False] | ||
self.virtual_scale_1 = [0.1, 0.1] | ||
|
||
type_map_2 = ["B", "Ni", "O"] |
Check notice
Code scanning / CodeQL
Unused local variable Note test
self.use_spin_2 = [False, True, False] | ||
self.virtual_scale_2 = [0.1, 0.1, 0.1] | ||
|
||
type_map_3 = ["H", "O", "B", "Ni", "O"] |
Check notice
Code scanning / CodeQL
Unused local variable Note test
LGTM |
This PR support DPSpin for AtomicModel:
Spin
base class to handle spin-related information.SpinModel
implementation in pt, which can generally take any backbone model, with input and output process for output likeenergy
,dipole
and etc.SpinEnergyModel
implementation inherited fromSpinModel
forenergy
calclulation.Input improvement, now DPSpin model can take real
spin
as input withvitual_scale
, which can support much more flexible input. (Also with dataset support forspin
input.)EnergySpinLoss
class to processenergy
,force_real
,force_mag
,virial
.Add
protection
for environment calculations.TODO:
forward_lower
forSpinModel
.data_stat
with generalexclude_types
for descriptors and fittings.SpinModel
models.Will fix in next PRs: