Skip to content

Feat: Refactor dipole fitting pytorch #3281

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

Merged
merged 19 commits into from
Feb 18, 2024
Merged

Conversation

anyangml
Copy link
Collaborator

@anyangml anyangml commented Feb 16, 2024

This PR is to provide implementation of equivariant diplole fitting in pytorch and backend-independent numpy.

@anyangml anyangml self-assigned this Feb 16, 2024
@@ -414,11 +414,12 @@
self.prec = PRECISION_DICT[self.precision]
self.rcond = rcond

net_dim_out = self._net_out_dim()

Check warning

Code scanning / CodeQL

`__init__` method calls overridden method

Call to self.[_net_out_dim](1) in __init__ method, which is overridden by [method DipoleFittingNet._net_out_dim](2). Call to self.[_net_out_dim](1) in __init__ method, which is overridden by [method InvarFitting._net_out_dim](3).
)
filter_layers.append(one)
self.filter_layers = torch.nn.ModuleList(filter_layers)
self.old_impl = False # this only supports the new implementation.

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class

Assignment overwrites attribute old_impl, which was previously defined in superclass [GeneralFitting](1).
Copy link

codecov bot commented Feb 16, 2024

Codecov Report

Attention: 17 lines in your changes are missing coverage. Please review.

Comparison is base (9053caf) 75.06% compared to head (b5f2582) 75.14%.
Report is 1 commits behind head on devel.

Files Patch % Lines
deepmd/dpmodel/fitting/general_fitting.py 94.11% 7 Missing ⚠️
deepmd/dpmodel/fitting/dipole_fitting.py 86.84% 5 Missing ⚠️
deepmd/dpmodel/fitting/invar_fitting.py 85.71% 2 Missing ⚠️
deepmd/pt/model/task/fitting.py 93.10% 2 Missing ⚠️
deepmd/pt/model/task/dipole.py 96.55% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3281      +/-   ##
==========================================
+ Coverage   75.06%   75.14%   +0.08%     
==========================================
  Files         387      389       +2     
  Lines       33640    33714      +74     
  Branches     1604     1600       -4     
==========================================
+ Hits        25251    25336      +85     
+ Misses       7528     7517      -11     
  Partials      861      861              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@anyangml anyangml marked this pull request as draft February 16, 2024 15:12
if self.spin is not None:
raise NotImplementedError("spin is not supported")

net_dim_out = self._net_out_dim()

Check warning

Code scanning / CodeQL

`__init__` method calls overridden method

Call to self.[_net_out_dim](1) in __init__ method, which is overridden by [method InvarFitting._net_out_dim](2).
@anyangml anyangml marked this pull request as ready for review February 17, 2024 11:41
@anyangml anyangml added the Test CUDA Trigger test CUDA workflow label Feb 18, 2024
@github-actions github-actions bot removed the Test CUDA Trigger test CUDA workflow label Feb 18, 2024
def setUp(self):
TestCaseSingleFrameWithNlist.setUp(self)
self.rng = np.random.default_rng()
self.nf, self.nloc, nnei = self.nlist.shape

Check notice

Code scanning / CodeQL

Unused local variable

Variable nnei is not used.
@anyangml
Copy link
Collaborator Author

@njzjz can we merge this PR before #3286, and then merge the PR for polar.

@anyangml anyangml added this pull request to the merge queue Feb 18, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 18, 2024
@wanghan-iapcm wanghan-iapcm added the Test CUDA Trigger test CUDA workflow label Feb 18, 2024
@github-actions github-actions bot removed the Test CUDA Trigger test CUDA workflow label Feb 18, 2024
@njzjz njzjz added this pull request to the merge queue Feb 18, 2024
Merged via the queue into deepmodeling:devel with commit 6451cdb Feb 18, 2024
@njzjz njzjz mentioned this pull request Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants