8000 SRV changes by shubhamtalbar96 · Pull Request #1525 · geomstats/geomstats · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

SRV changes #1525

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 17 commits into from
May 16, 2022
Merged

SRV changes #1525

merged 17 commits into from
May 16, 2022

Conversation

shubhamtalbar96
Copy link
Contributor
  1. Put a check in SRV Transform method to ensure that there are no consecutive duplicate points in a curve.
  2. Made change in SRV Transform method to change the dimensionally of encoding ambient space if the Metric used is of instance type SRV Metric.
  3. Introduced a new method predict_labels in Riemannian Mean Shift class to predict labels for the points passed as an argument.

1. Throw an exception if the curve passed to SRV Transform has consecutive duplicate points
2. Fix the closest neighbor index method to return the index of closest point rather than the distance itself.
3. Change the me
10000
tric dimension of ambient space encoding a manifold if the metric is of type SRV Metric.
4.  Adding a new predict_labels method inside Riemannian Mean Shift class to assign labels to the set of points passed.
@codecov
Copy link
codecov bot commented May 4, 2022

Codecov Report

Merging #1525 (b2129e8) into master (afe8133) will decrease coverage by 0.04%.
The diff coverage is 81.76%.

@@            Coverage Diff             @@
##           master    #1525      +/-   ##
==========================================
- Coverage   82.88%   82.84%   -0.03%     
==========================================
  Files          96       96              
  Lines        9750     9763      +13     
==========================================
+ Hits         8080     8087       +7     
- Misses       1670     1676       +6     
Flag Coverage Δ
pytorch 82.84% <81.76%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
geomstats/_backend/__init__.py 77.78% <ø> (ø)
geomstats/learning/online_kmeans.py 18.19% <0.00%> (-0.42%) ⬇️
geomstats/learning/riemannian_mean_shift.py 90.63% <50.00%> (-4.61%) ⬇️
geomstats/geometry/discrete_curves.py 68.07% <75.00%> (-<0.01%) ⬇️
geomstats/learning/frechet_mean.py 92.45% <80.00%> (-0.31%) ⬇️
geomstats/geometry/pullback_metric.py 87.91% <83.88%> (ø)
geomstats/geometry/riemannian_metric.py 88.29% <95.00%> (+0.58%) ⬆️
geomstats/_backend/pytorch/__init__.py 95.11% <100.00%> (ø)
geomstats/learning/mdm.py 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63dff0e...b2129e8. Read the comment docs.

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.

Thank you!! Some minor changes are needed.

@ninamiolane ninamiolane requested a review from luisfpereira May 4, 2022 20:36
A new test case for predict_labels in Riemannian Mean Shift method
@shubhamtalbar96
Copy link
Contributor Author

@ninamiolane please review the new test case at your convenience added for maintaining code coverage

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.

Sorry I missed it earlier: the tests are failing (see Github actions) because the notebook of cell shapes is failing, which is because the cell shapes have consecutives points there.

Add the preprocess function that removes consecutives points, delete the part of the notebooks that talks about good and bad cells (not needed anymore) and make the notebook pass the tests.

Thanks!

@ninamiolane
Copy link
Collaborator

@shubhamtalbar96 the multiple checks about NaNs, in the notebook on cell shapes, might not be needed anymore. If they are not needed, could you remove them? Many thanks.

@shubhamtalbar96
Copy link
Contributor Author

Sure, thank you for the inputs. Will get back shortly.

Added a new preprocess method to remove duplicate points in a discrete curve.
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@shubhamtalbar96
Copy link
Contributor Author

@ninamiolane can you check the diff in the notebook now?

Copy link
Collaborator
@luisfpereira luisfpereira left a comment

Choose a reason for hiding this comment

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

Thanks @shubhamtalbar96! I have some comments that I would like you to address. Probably @ninamiolane can add info in some of them.

@ninamiolane, the notebook on cell shape analysis is breaking because the added check is doing its job: ds_align['jasp']['dlm8'] has overlapping consecutive points.

1. Removed class level tolerance variable
2. Updated metric in Tests for RMS
3. Moved common code to a private function within RMS Test Class
@ninamiolane
Copy link
Collaborator

The cell shape analysis notebook is still failing.

Screen Shot 2022-05-05 at 4 22 11 PM

@luisfpereira
Copy link
Collaborator

@shubhamtalbar96 have you performed changes in the cell shape analysis notebook in this PR? For some reason github is not considering it to be a part of "files changed"

Added a preprocess method to remove duplicate data points in a discrete curve
Added a static method decorator to fix DeepSource issue
@shubhamtalbar96
Copy link
Contributor Author

@LPereira95 apologies the notebook changes were not part of the PR because of an incorrect merge conflict resolution. You should see the changes now in File Changes.

Copy link
Collaborator
@luisfpereira luisfpereira left a comment

Choose a reason for hiding this comment

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

Thanks @shubhamtalbar96!

The notebook runs properly now (I haven't made a thorough review there).

Can you address these last (picky) comments, please?

1. Changed the default value of tol in SRV Transform to gs.atol
2. Updated Test Cases in RMS
@ninamiolane
Copy link
Collaborator

@shubhamtalbar96 the predict_label function of riemannian_mean_shift is failing, please fix.

To see which tests are failing, click on "Details" for the checks that were not successful.

  • If the failing tests are not part of your changes, we can ignore them (@LPereira95 we probably need to fix the sensitivity of the random tests at some point)
  • Otherwise, you have to fix them.

Screen Shot 2022-05-10 at 6 25 56 PM

@@ -16,14 +16,13 @@ class TestRiemannianMeanShift(geomstats.tests.TestCase):
@geomstats.tests.np_autograd_and_torch_only
def test_hypersphere_riemannian_mean_shift_predict(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

here we should remove riemannian_mean_shift from the name of this function: we know that we are in the riemannian_mean_shift test, from the name of the file: test_riemannian_mean_shift.py

@shubhamtalbar96 Could you u EF07 pdate the names of all the tests accordingly? Thanks

@luisfpereira
Copy link
Collaborator

@ninamiolane the failing of riemannian_mean_shift is due to the fact that #1530 was not merged yet. I'm just solving some tensorflow issues there and I'll soon merge, so this can also be merged.

@luisfpereira luisfpereira merged commit 1547d2d into geomstats:master May 16, 2022
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.

3 participants
0