-
Notifications
You must be signed in to change notification settings - Fork 516
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
add BaseModel; store type in serialization #3335
Conversation
Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
from deepmd.pt.model.model.dipole_model import ( | ||
DipoleModel, | ||
) |
Check notice
Code scanning / CodeQL
Cyclic import Note
deepmd.pt.model.model.dipole_model
from deepmd.pt.model.model.ener_model import ( | ||
EnergyModel, | ||
) |
Check notice
Code scanning / CodeQL
Cyclic import Note
deepmd.pt.model.model.ener_model
from deepmd.pt.model.model.polar_model import ( | ||
PolarModel, | ||
) |
Check notice
Code scanning / CodeQL
Cyclic import Note
deepmd.pt.model.model.polar_model
@@ -17,7 +20,8 @@ | |||
DPZBLModel_ = make_model(DPZBLLinearAtomicModel) | |||
|
|||
|
|||
class DPZBLModel(DPZBLModel_): | |||
@BaseModel.register("zbl") | |||
class DPZBLModel(DPZBLModel_, BaseModel): |
Check warning
Code scanning / CodeQL
Conflicting attributes in base classes Warning
Function compute_or_load_stat
Function compute_or_load_stat
Base classes have conflicting values for attribute 'compute_or_load_stat': Function compute_or_load_stat and
Function compute_or_load_stat
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #3335 +/- ##
==========================================
+ Coverage 75.52% 75.57% +0.05%
==========================================
Files 408 409 +1
Lines 34277 34377 +100
Branches 1604 1600 -4
==========================================
+ Hits 25888 25982 +94
- Misses 7528 7534 +6
Partials 861 861 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
DPModel = make_model(DPAtomicModel) | ||
|
||
@BaseModel.register("standard") | ||
class DPModel(make_model(DPAtomicModel), BaseModel): |
Check warning
Code scanning / CodeQL
Conflicting attributes in base classes Warning
Function compute_or_load_stat
Function compute_or_load_stat
Base classes have conflicting values for attribute 'compute_or_load_stat': Function compute_or_load_stat and
Function compute_or_load_stat
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 do not understand why the
serialization
anddeserialization
cannot be put intBaseBaseModel
. - would the following inheritance work?
# torch.nn.Module BaseAtomicModel BaseBaseModel
# | | |
# ------------------------- |
# | |
# DPAtomicModel |
# | |
# make_model(DPAtomicModel) |
# | |
# ----------------------------------
# |
# DPModel
- in our concept a model is an atomic model, therefore, the base model seems to be a facilitate that provides the plugin, other methods like the
get_rcut
,get_dim_fparam
... seems to be inherited from atomic model rather than model .
Co-authored-by: Han Wang <[email protected]> Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: Han Wang <[email protected]> Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
This reverts commit 054fba6.
Signed-off-by: Jinzhe Zeng <[email protected]>
Done.
We cannot store the plugins of dpmodel and pt in the same class. There must be seperately classes to initialize the plugin separately.
It looks to me |
Signed-off-by: Jinzhe Zeng <[email protected]>
it should be possible to |
Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
No description provided.