add BaseModel; store type in serialization#3335
add BaseModel; store type in serialization#3335wanghan-iapcm merged 17 commits intodeepmodeling:develfrom
Conversation
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
| from deepmd.pt.model.model.dipole_model import ( | ||
| DipoleModel, | ||
| ) |
Check notice
Code scanning / CodeQL
Cyclic import
| from deepmd.pt.model.model.ener_model import ( | ||
| EnergyModel, | ||
| ) |
Check notice
Code scanning / CodeQL
Cyclic import
| from deepmd.pt.model.model.polar_model import ( | ||
| PolarModel, | ||
| ) |
Check notice
Code scanning / CodeQL
Cyclic import
|
|
||
| class DPZBLModel(DPZBLModel_): | ||
| @BaseModel.register("zbl") | ||
| class DPZBLModel(DPZBLModel_, BaseModel): |
Check warning
Code scanning / CodeQL
Conflicting attributes in base classes
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 <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
| DPModel = make_model(DPAtomicModel) | ||
|
|
||
| @BaseModel.register("standard") | ||
| class DPModel(make_model(DPAtomicModel), BaseModel): |
Check warning
Code scanning / CodeQL
Conflicting attributes in base classes
wanghan-iapcm
left a comment
There was a problem hiding this comment.
- I do not understand why the
serializationanddeserializationcannot 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 <92130845+wanghan-iapcm@users.noreply.github.com> Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Co-authored-by: Han Wang <92130845+wanghan-iapcm@users.noreply.github.com> Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
This reverts commit 054fba6.
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
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 <jinzhe.zeng@rutgers.edu>
it should be possible to |
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
No description provided.