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

gp sampler: GPy -> scikit-learn #69

Merged
merged 1 commit into from
Sep 19, 2023
Merged

gp sampler: GPy -> scikit-learn #69

merged 1 commit into from
Sep 19, 2023

Conversation

AldoGl
Copy link
Contributor

@AldoGl AldoGl commented Sep 18, 2023

Proposed changes

I change the backend of the GPSampler using the scikit-learn implementation instead of the GPy one.

Fixes

This also solves #36.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

@AldoGl
Copy link
Contributor Author

AldoGl commented Sep 18, 2023

The failing tests do not seem related to the changes, and are probably fixed by #68 and #62

@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 2023

Codecov Report

Merging #69 (6a8558e) into main (c5a5b88) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 6a8558e differs from pull request most recent head eab098e. Consider uploading reports for the commit eab098e to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
+ Coverage   91.36%   91.38%   +0.01%     
==========================================
  Files          42       42              
  Lines        1737     1729       -8     
==========================================
- Hits         1587     1580       -7     
+ Misses        150      149       -1     
Files Changed Coverage Δ
black_it/samplers/gaussian_process.py 100.00% <100.00%> (+1.38%) ⬆️

setup.cfg Outdated Show resolved Hide resolved
@@ -37,6 +37,7 @@
batch_id # unused variable (black_it/schedulers/base.py:77)
batch_id # unused variable (black_it/schedulers/round_robin.py:47)
MABEpsilonGreedy # unused class (black_it/schedulers/rl/agents/epsilon_greedy.py:26)
seed # unused variable (black_it/schedulers/rl/envs/base.py:59)
Copy link
Contributor

Choose a reason for hiding this comment

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

for some reason this vulture error was activated after the first commit of this PR.

@marcofavoritobi marcofavoritobi force-pushed the from_GPy_to_sklearn branch 2 times, most recently from fe677e7 to 21a93ad Compare September 19, 2023 09:01
BREAKING CHANGE: This commit updates the implementation of GaussianProcessSampler. Instead of relying on GPy, now we use the implementation of Gaussian Processes provided by the scikit-learn package.

The change introduces a different behaviour of the GaussianProcessSampler, even if the same random seed is provided. This is witnessed by the updated expected sampled parameters and losses in tests/test_calibrator.py.

Another notable difference is in the keyword arguments for the GaussianProcessSampler class constructor. In particular:
- the keyword argument 'max_iters' has been removed
- the keyword argument 'jitter' has been added.
Comment on lines -79 to +80
self.max_iters = max_iters
self.optimize_restarts = optimize_restarts
self.acquisition = acquisition
self._gpmodel: Optional[GPRegression] = None
self.jitter = jitter
Copy link
Contributor

Choose a reason for hiding this comment

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

optimize_restarts, acquisition and jitter should be protected attributes. We can fix this in another PR.

@AldoGl
Copy link
Contributor Author

AldoGl commented Sep 19, 2023

Thank you @marcofavoritobi @muxator! Merging now

@AldoGl AldoGl merged commit 1c4a3b6 into main Sep 19, 2023
10 checks passed
@AldoGl AldoGl deleted the from_GPy_to_sklearn branch September 19, 2023 10:34
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.

4 participants