8000 Clean discrete surfaces elastic metric by luisfpereira · Pull Request #1986 · geomstats/geomstats · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Clean discrete surfaces elastic metric #1986

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 3 commits into from
Apr 16, 2024

Conversation

luisfpereira
Copy link
Collaborator
@luisfpereira luisfpereira commented Apr 4, 2024

This PR cleans the discrete surfaces elastic metric:

  • einsums are replaced by proper backend functions

  • docstrings are fixed and simplified

  • default solvers are only instantiated if an autodiff-based backend is used (this way we can compute inner products with numpy)

  • a potential bug is solved in _inner_prod_a2 (@emmanuel-hartman, could you please confirm we should multiply by vertex areas instead of divide? this comes from the original implementation)

@luisfpereira luisfpereira requested a review from ninamiolane April 4, 2024 13:14
Copy link
codecov bot commented Apr 4, 2024

Codecov Report

Attention: Patch coverage is 6.66667% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 88.82%. Comparing base (cadbda2) to head (746fc4d).
Report is 36 commits behind head on main.

❗ Current head 746fc4d differs from pull request most recent head c8723b7. Consider uploading reports for the commit c8723b7 to get more accurate results

Files Patch % Lines
geomstats/geometry/discrete_surfaces.py 6.67% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1986      +/-   ##
==========================================
- Coverage   92.10%   88.82%   -3.27%     
==========================================
  Files         158      147      -11     
  Lines       14442    13711     -731     
==========================================
- Hits        13300    12178    -1122     
- Misses       1142     1533     +391     
Flag Coverage Δ
autograd ?
numpy 88.82% <6.67%> (-0.10%) ⬇️
pytorch ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Collaborator
@ninamiolane ninamiolane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

@@ -514,26 +514,23 @@ def __init__(self, space, a0=1.0, a1=1.0, b1=1.0, c1=1.0, d1=1.0, a2=1.0):
self.d1 = d1
self.a2 = a2

self.exp_solver = DiscreteSurfacesExpSolver(space, n_steps=10)
if not gs.__name__.endswith("numpy"):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a less hacky way to test the backend?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the name no... probably something to add.

@luisfpereira
Copy link
Collaborator Author

Changing the division to a multiplication in _inner_prod_a2 impacts a lot the results (as expected). Probably a closer look to this is important to ensure I'm not missing out something.

…this comes from the fact laplacian is not normalized by vertex areas) (brings code back to previous state)
@luisfpereira
Copy link
Collaborator Author

After looking carefully to some equations, I believe _inner_prod_a2 was properly implemented (it should be a division, not a multiplication). In any case, a third-party confirmation of this is welcome.

Good to merge from my side.

7E14
@luisfpereira luisfpereira merged commit e70aa4d into geomstats:main Apr 16, 2024
8 of 9 checks passed
@luisfpereira luisfpereira deleted the discrete-surfaces branch April 16, 2024 16:32
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.

2 participants
0