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

Add HSGP contribution module #1794

Merged
merged 6 commits into from May 13, 2024
Merged

Conversation

juanitorduz
Copy link
Contributor

Closes #1788

Motivation: As described in the issue

I have been using the Hilber Space approximation for Gaussian Processes a lot. The main ingredients are the spectral densities of the kernels and the eigenvalues and eigenvectors of the Laplacian in a box, see https://num.pyro.ai/en/stable/examples/hsgp.html

Scope of this PR:

  • Basic module and descriiption
  • Docstrings
  • Tests
  • Documentation
  • Example Notebook

I would consider this module experimental to get user feedback (as described in the docs). For now, it just supports one-dimensional inputs (my most common use case). In the next iteration, I will add an extension to higher dimensions. I did not want to over-complicate this first PR.

Happy to get feedback :)

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@martinjankowiak
Copy link
Collaborator

it'd be great to get feedback from @omarfsosa who wrote the hsgp example in the first place

@juanitorduz
Copy link
Contributor Author

juanitorduz commented May 6, 2024

I did not know @omarfsosa was the original author. I give credit to the example in many places, but I can also add his name (or GitHub handle) to the docs as I'm essentially organizing the functions from the example and adding docs and tests 😄

@juanitorduz
Copy link
Contributor Author

I did not know @omarfsosa was the original author. I give credit to the example in many places, but I can also add his name (or GitHub handle) to the docs as I'm essentially organizing the functions from the example and adding docs and tests 😄

Added reference to original author to the module page in 2b1e37d

@omarfsosa
Copy link
Contributor

This is really cool @juanitorduz ! I've often reused some of those functions but found myself copy-pasting stuff cause I never had the time to write it properly so I really appreciate this. I think it's looking really good, my only nit would be the naming of the "ell" parameter in some of the functions, but I can see why you did that and tbh I don't have a better suggestion for now.

@juanitorduz
Copy link
Contributor Author

Thanks for the feedback! Exactly! I was copy pasting this a lot as well 😄!

Regarding the variable name: the original name is L but I don't find it esthetic as it is upper case and l is not encouraged as it is hard to read so I had to go with ell. If some of the NumPyro devs have another suggestion I am open 🙂

docs/source/contrib.rst Outdated Show resolved Hide resolved
docs/source/contrib.rst Outdated Show resolved Hide resolved
docs/source/contrib.rst Outdated Show resolved Hide resolved
docs/source/contrib.rst Outdated Show resolved Hide resolved
numpyro/contrib/hsgp/approximation.py Outdated Show resolved Hide resolved
numpyro/contrib/hsgp/approximation.py Outdated Show resolved Hide resolved
numpyro/contrib/hsgp/approximation.py Outdated Show resolved Hide resolved
numpyro/contrib/hsgp/approximation.py Outdated Show resolved Hide resolved
numpyro/contrib/hsgp/laplacian.py Show resolved Hide resolved
@fehiepsi fehiepsi added this to the 0.15 milestone May 12, 2024
Copy link
Member

@fehiepsi fehiepsi left a comment

Choose a reason for hiding this comment

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

Thanks @juanitorduz for this great contribution! Thanks @omarfsosa and @martinjankowiak for reviewing! :)

@fehiepsi fehiepsi merged commit 753553f into pyro-ppl:master May 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HSGP utility functions in the contrib module?
4 participants