Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contributor Agreements
Please read the contributor agreements and if you agree, please click the checkbox below.
Tip
Please follow the Quick TODO list to smoothly merge your PR.
Motivation
Make ConfOpt available as a Sampler in Optuna.
Description of the changes
Overview:
Adds ConfOpt as a new Sampler.
Implementation Notes:
QuantileConformalSearcheraccording to user inputs (with expert defaults).sample_relative()call, which fitsQuantileConformalSearcherto all currently available trials (user can specify whether to train on only completed, or also pruned trials) and selects next configuration to evaluate through objective function.after_trial()call, which calls theQuantileConformalSearcher'supdate()method. This will perform a series of internal ConfOpt updates on theQuantileConformalSearcherstate (namely conformal prediction adjustments and acquisition function updates).In addition to default search, implementation supports (tested):
n_jobsOptuna parameter in.optimize().Note, to allow for safe parallelization, a thread safe local copy of
QuantileConformalSearcheris used insample_relative(). Fit and predict method changes to the searcher's state are unimportant and don't need to persist between trials, so using a local copy per trial is harmless.In
after_trial(), we force a lock, so only one thread/process can update the true, non-copied,QuantileConformalSearcherobject with after trial information (preserving single source of truth for searcher's permanent/cumulative states). The lock doesn't worsen parallelization performance, since the update takes fractions of a second.TODO List towards PR Merge
Please remove this section if this PR is not an addition of a new package.
Otherwise, please check the following TODO list:
./template/to create your package<COPYRIGHT HOLDER>inLICENSEof your package with your nameREADME.mdin your package__init__.pyfrom __future__ import annotationsat the head of any Python files that include typing to support older Python versionsREADME.mdREADME.md