Skip to content
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

Bug in Healpix sampling in pygsp #7

Closed
aluo-x opened this issue Dec 27, 2020 · 10 comments
Closed

Bug in Healpix sampling in pygsp #7

aluo-x opened this issue Dec 27, 2020 · 10 comments

Comments

@aluo-x
Copy link
Contributor

aluo-x commented Dec 27, 2020

Not sure the correct place to put this bug, but currently the healpix sampling is broken.

If we pass n_neighbors=None, the code in pygsp checks for Nside when function accepts nside.

@aluo-x
Copy link
Contributor Author

aluo-x commented Dec 28, 2020

Additionally, the current install instructions for pygsp gives a broken version for HealPix. As the kernel widths are only defined down to 32, which breaks pooling for smaller graphs.

We should move directly to the head of the new_sphere_graph branch. I also believe the currently returned lat lon for healpy are incorrect, as the healpy documentation claims that it is returning colat & lon.

@mdeff
Copy link
Member

mdeff commented Mar 18, 2021

Thanks for reporting those issues!

If we pass n_neighbors=None, the code in pygsp checks for Nside when function accepts nside.

There was indeed a bug in the PyGSP.

As the kernel widths are only defined down to 32, which breaks pooling for smaller graphs.

I've expanded the range from 1 to 2048 in epfl-lts2/pygsp@c69398b.

I also believe the currently returned lat lon for healpy are incorrect, as the healpy documentation claims that it is returning colat & lon.

Right. This has been fixed.

We should move directly to the head of the new_sphere_graph branch.

Agreed. And that will fix all the issues. 🙂 I've updated the instructions in the README.

@mdeff mdeff closed this as completed Mar 18, 2021
@aluo-x
Copy link
Contributor Author

aluo-x commented Mar 19, 2021

I believe the updated instructions still give a "broken" installation.

class SphereHealpix(NNGraph):
    def __init__(self, subdivisions=2, indexes=None, nest=False)

This repo is expecting nest=True, but fails to explicitly set the nest=True

Edit: fix typo

@aluo-x
Copy link
Contributor Author

aluo-x commented Mar 19, 2021

Specifically this line will have to be updated to

G = SphereHealpix(subdivisions, nest=True)

Additionally, the "n_neighbors" or "k" parameter should probably be exposed, the current default is 20, while 8 may be sufficient.

@mdeff
Copy link
Member

mdeff commented Mar 19, 2021

Arf you're right. I changed the default in pygsp to nest=False to follow healpy's default. While it doesn't matter for the graph convolution, it does for the pooling. (I missed it because we're developing a new pooling based on interpolation between meshes of different resolutions in https://github.com/deepsphere/deepsphere-weather, which doesn't care about ordering.)

Where do you think we should expose k? Just in this call to make it more visible?

@aluo-x
Copy link
Contributor Author

aluo-x commented Mar 19, 2021

I have no super strong opinion about the k, I feel like if people really need that kind of tuning they will find it. But if it is exposed, then in that call would be the place. (But k is less informative compared to n_neighbors).

The nested=True is more important, since pooling assumes it to be nested, will you push a fix?

Edit: typo

@aluo-x
Copy link
Contributor Author

aluo-x commented Mar 19, 2021

Also the new repo is very cool! Will look more deeply into it tomorrow.

@mdeff
Copy link
Member

mdeff commented Mar 19, 2021

Thanks! :)

Yes the nest needs to be fixed. Let's go with the k in that call too. I'll do it or merge a PR if you want to do it.

But k is less informative compared to n_neighbors

I agree. It's clear where it's defined (a kNN graph class) but not so much in the HEALPix child class (and many other child classes). We might rename it at some point (ping epfl-lts2/pygsp#43). (n_neighbors was special-casing HEALPix that's why it got removed.)

@aluo-x
Copy link
Contributor Author

aluo-x commented Mar 19, 2021

Would appreciate a fix from you! It's nearly midnight here in the U.S.

mdeff added a commit that referenced this issue Mar 19, 2021
Also highlight the number of neighbors as a parameter.
Fixes omission from fixing #7
@mdeff
Copy link
Member

mdeff commented Mar 19, 2021

Done! 9ee5d09

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants