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

Feature/gpu priors #211

Merged
merged 124 commits into from
May 6, 2022
Merged

Feature/gpu priors #211

merged 124 commits into from
May 6, 2022

Conversation

nbarlowATI
Copy link
Member

Refactoring the C++/GPU implementation to hold hyperparameters in a GPParams object, and introduce priors for hyperparameters following the same logic as the Python/CPU implementation.

  • New C++ classes and corresponding Python bindings:
    • GPParams - holds values of parameters for mean function and kernel parameters (including nugget)
    • GPPriors - container class for Prior objects, including:
    • MeanPriors - not yet used in analytical meanfunc calculation, but still containing much of the necessary functionality.
    • WeakPrior - base class for other prior distributions
    • NormalPrior
    • LogNormalPrior
    • InvGammaPrior
  • Default behaviour and interface of GPPriors in the C++ / GPU implementation is identical to that in the Python/CPU implementation: if no GPPriors object is passed to the GP's constructor, default will be InvGammaPrior with appropriately chosen shape and scale for the correlation length parameters
  • If a python GPPriors object is provided, python code in GaussianProcessGPU will ascertain what prior distributions and parameters need to be passed to the C++ class for it to construct the corresponding C++ versions.
  • The code in fitting.hpp will use the GPPriors::sample method to obtain starting values for the fit, rather than uniform random values.

edaub added 30 commits August 11, 2021 16:05
@nbarlowATI nbarlowATI requested a review from edaub January 6, 2022 19:12
Copy link
Collaborator

@edaub edaub left a comment

Choose a reason for hiding this comment

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

Mostly looks good -- a few things in the code I though might be cleaner, and a few random thoughts/questions.

Two things I that do need to be fixed:

  • The correlation length priors appear to all enforce the same distribution (or I missed something) in GaussianProcessGPU.py

  • Clarify what is going on with the distributions in MeanPriors in the C++ implementation (and that currently it only implements weak priors). In particular, I'd get rid of the other distributions and just make it clear with some comments that you need to make a bunch of weak prior objects for sampling purposes.

edaub and others added 20 commits March 25, 2022 16:26
…ulators for n_params, in common with CPU implementation.
…or function which is a duplicate of set_nugget
…allow (for future) different prior dists to be set for different meanfunc parameters (even though they're not currently used in logpost calculation
@nbarlowATI nbarlowATI merged commit c233e2d into devel May 6, 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.

2 participants