Conversation
- Add ard=False to bayes_search() in all six policy classes (discrete, range, discrete_multi, range_multi, discrete_unified, range_unified) - Introduce _make_gp_predictor(num_dim=None) in discrete and range policies to create GP predictor with optional ARD (Automatic Relevance Determination) - When ard=True, use Gauss kernel with per-dimension width; require training data (e.g. from random_search) before bayes_search for input dimension - Add test_bayes_search_ard to verify ard=True sets predictor with ARD kernel Made-with: Cursor
- Add ard=False parameter to bayes_search in discrete, range, discrete_multi, range_multi policies - Add get_kernel_length_scale() to policy for inspecting learned kernel width(s) - Add ard_example.py: compare ard=True vs ard=False (best value, length scale, permutation importance) - Add unit test for get_kernel_length_scale Made-with: Cursor
…model - Add _make_gp_model() to discrete and range policies; use it for both GP and BLM. - When num_rand_basis > 0 and ard=True, pass ARD GP model to blm_predictor so random feature expansion uses per-dimension length scales. - _make_gp_model(ard=False) now returns the default GP model instead of None. - _make_gp_predictor always uses the model from _make_gp_model. - Apply BLM+ARD init in discrete_multi, range_multi, discrete_unified, range_unified. - Simplify ard and get_kernel_length_scale docstrings. Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
This PR adds Automatic Relevance Determination (ARD) support to PHYSBO's Bayesian optimization framework. ARD enables per-dimension length scales in the Gaussian kernel, allowing the GP surrogate to automatically identify which input dimensions are relevant to the objective function.
Changes:
- Added
ard=Trueparameter tobayes_searchmethod across all 6 policy classes (discrete, discrete_multi, discrete_unified, range, range_multi, range_unified) - Added
get_kernel_length_scale()method to retrieve learned length scales from the GP model in all policy variants - Added
_make_gp_modeland_make_gp_predictorhelper methods to create GP models/predictors with optional ARD kernel - Added documentation (English/Japanese tutorials), example script, and unit tests for the new functionality
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/physbo/search/discrete/_policy.py |
Core ARD support: ard param in bayes_search, get_kernel_length_scale, _make_gp_model, _make_gp_predictor |
src/physbo/search/range/_policy.py |
Mirror of discrete's ARD support for continuous search space policies |
src/physbo/search/discrete_multi/_policy.py |
ARD in multi-objective discrete search; overrides get_kernel_length_scale for list return |
src/physbo/search/range_multi/_policy.py |
ARD in multi-objective range search; overrides get_kernel_length_scale for list return |
src/physbo/search/discrete_unified/_policy.py |
ARD in unified-objective discrete search (inherits get_kernel_length_scale) |
src/physbo/search/range_unified/_policy.py |
ARD in unified-objective range search (inherits get_kernel_length_scale) |
tests/unit/test_policy.py |
Unit tests for ARD kernel creation and get_kernel_length_scale (discrete only) |
examples/single_objective/ard_example.py |
Example script demonstrating ARD vs isotropic kernel |
docs/sphinx/manual/en/source/notebook/tutorial_ard.ipynb |
English ARD tutorial notebook |
docs/sphinx/manual/ja/source/notebook/tutorial_ard.ipynb |
Japanese ARD tutorial notebook |
docs/sphinx/manual/en/source/notebook/index.rst |
Add ARD tutorial to English docs index |
docs/sphinx/manual/ja/source/notebook/index.rst |
Add ARD tutorial to Japanese docs index |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add Model.create_default(ard=False, num_dim=None) in gp.core._model to build default Gauss kernel + Const mean + Gauss likelihood. - Remove _make_gp_model from discrete and range policies; use gp.core.Model.create_default(ard=..., num_dim=...) instead. - Update discrete_multi, range_multi, discrete_unified, range_unified to call Model.create_default for BLM+ARD predictor init. - Add gp import where needed in multi/unified policy modules. Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- range: remove num_dim from _init_predictor and _make_gp_predictor; add _make_blm_predictor(); both use self.ard and self.get_num_dim(). - range_multi, range_unified: create BLM predictor via _make_blm_predictor() instead of inline create_default; drop unused gp import. Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Instead of the Gaussian kernel
the ARD kernel
is now available by passing
ard=Truetobayes_searchmethod of eachPolicy.A new method$\vec{\eta}$ , which reflects sensiblity of each dimension of input to the objective function.
policy.get_kernel_length_scalereturns