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

Fix GP Demos #236

Merged
merged 9 commits into from
Jul 18, 2022
Merged

Fix GP Demos #236

merged 9 commits into from
Jul 18, 2022

Conversation

edaub
Copy link
Collaborator

@edaub edaub commented Jun 1, 2022

Bugfixes to correct the GP demos to ensure that they run with the new
implementation. Addresses issues #234, #235. Changes include:

  • Update Patsy integration to allow using formulae with LHS
  • Unit tests to confirm correct behavior of LHS formulae
  • Update gp_demos.py
  • Update gp_demo.R
  • Update excalibur_workshop_demo.py
  • Update gp_kernel_demos.py
  • Update multioutput_tutorial.py
  • Add new printing function to the projectile code to replace previous, modified above demos to use this.

edaub added 5 commits June 1, 2022 15:30
Bugfixes to correct the GP demos to ensure that they run with the new
implementation. Changes include

- Update Patsy integration to allow using formulae with LHS
This commit updates several of the demos to work with the new
interface to the GP class. In particular, priors and mean functions
had to be changed, and some additional calls to the validation
methods have been used to replace existing validation code.

Note that the MICE code does not currently work with the new
interface, as this will require some re-working of the code.
This demo has been left unchanged.
Fixes a bug that arises when a LHS is provided for a formula. Corrected
the code and added a unit test that catches this situation.
Corrected the gp_demo.R file to correctly use the new prior
interface. Verified that the demo runs correctly and can be
used as an example script.
Test file to run all demos doesn't currently work due to issues with
RNG and plot displays, so I am removing from the index for the time
being. This issue will be addressed at another time.
@edaub edaub requested a review from nbarlowATI July 4, 2022 14:48
Copy link
Member

@nbarlowATI nbarlowATI left a comment

Choose a reason for hiding this comment

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

Looks good, and all the tests and demos run both on my machine and on CSD3.
For completeness, I will add a couple of lines to test_GaussianProcessGPU_init in test_GaussianProcess.py checking that the GPU version can also cope with patsy formulas with a LHS.

@@ -55,6 +55,9 @@ def test_GaussianProcess_init(x, y):
gp = GaussianProcess(x, y, mean="x[0]")
assert gp._dm.shape == (2, 2)

gp = GaussianProcess(x, y, mean="y ~ x[0]")
Copy link
Member

Choose a reason for hiding this comment

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

I should add a couple of lines to the GPU version of this test, to check that it can also deal with a LHS of a patsy formula (it can, I just checked by hand, but good to have it in the tests too...)

@edaub edaub merged commit 7f2a0ad into main Jul 18, 2022
@edaub edaub mentioned this pull request Jul 18, 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