-
Notifications
You must be signed in to change notification settings - Fork 263
Simplify computations of the FrechetMean for the ElasticMetric #1592
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1592 +/- ##
==========================================
+ Coverage 88.65% 89.70% +1.06%
==========================================
Files 107 107
Lines 10694 10669 -25
==========================================
+ Hits 9480 9570 +90
+ Misses 1214 1099 -115
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
The failing tests are not related to this PR. |
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.
Looks good to me ! I may be missing something, but the version to which the changes are compared does not seem to be the current version of the master branch.
@@ -464,7 +465,7 @@ def __init__( | |||
" equipped with a metric." | |||
) | |||
self.ambient_manifold = ambient_manifold | |||
self.l2_metric = L2CurvesMetric(ambient_manifold=ambient_manifold) | |||
self.l2_curve_metric = L2CurvesMetric(ambient_manifold=ambient_manifold) |
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.
Maybe rename to l2_curves_metric
for coherence, or L2CurvesMetric
to L2CurveMetric
?
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.
Yes, done!
@@ -670,7 +671,7 @@ def f_transform_inverse(self, f, starting_point): | |||
) | |||
if gs.ndim(f) != gs.ndim(starting_point): | |||
starting_point = gs.to_ndarray(starting_point, to_ndim=f.ndim, axis=-2) | |||
self.l2_metric | |||
self.l2_curve_metric |
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.
What does this line do ? I don't see it in the current version of the master branch. For some reason, the current version used to compare changes in this PR does not seem to correspond to the current version of the master branch.
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.
This was a left over,thanks for catching it
distance = 2 * self.b * gs.arccos(gs.clip(cosine, -1, 1)) | ||
else: | ||
distance = l2_dist(f_1, f_2) | ||
# elastic_metric.dist |
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.
Leftover comments ?
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.
yes, thanks
This PR aimed to simplify the computation of the FrechetMean for the ElasticMetric, and ended up solving a series of bugs on elastic curves.
The method for the FrechetMean on elastic curves works as follows:
This PR also:
Checklist
Description
Issue
Additional context