-
-
Notifications
You must be signed in to change notification settings - Fork 960
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
Add the explanation of how to sample the best expected params to FAQ #5339
base: master
Are you sure you want to change the base?
Add the explanation of how to sample the best expected params to FAQ #5339
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5339 +/- ##
=======================================
Coverage 89.64% 89.65%
=======================================
Files 210 210
Lines 13289 13288 -1
=======================================
Hits 11913 11913
+ Misses 1376 1375 -1 ☔ View full report in Codecov by Sentry. |
@contramundum53 @HideakiImamura Could you review this PR? |
@@ -714,3 +714,66 @@ Optuna may sometimes suggest parameters evaluated in the past and if you would l | |||
|
|||
study = optuna.create_study() | |||
study.optimize(objective, n_trials=100) | |||
|
|||
How can I sample the best expected parameters based on the evaluated trials? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some people need the parameters without sampling a new trial, so maybe it's beneficial to introduce the non-sampler way that directly uses _gp
classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also it should be pointed out that this is a "hack" and it is not officially supported. It is possible that the interface changes in the future.
This pull request has not seen any recent activity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me leave a minor comments. I also think some references to gaussian processes would be helpful to understand the technical terms, such as UCB and acquisition function, especially for users who are not familiar with gaussian processes.
|
||
As the optimization often overtunes the parameters of an objective function with an observational noise, it is convenient to sample the best parameters based on the debiased objective function. | ||
:class:`~optuna.samplers.GPSampler` enables us to sample the best expected parameters using the mean estimation of parameters. | ||
Note that the best expected parameters are defined as :math:`\mathrm{arg}\min_{x \in X} \mathbb{E}_{f}[f(x)]` where :math:`f` follows the Gaussian process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
def objective(trial, evaluate_func=True): | ||
X = np.array([trial.suggest_float(f"x{i}", -5, 5) for i in range(2)]) | ||
if evaluate_func: | ||
# Could be a very expensive evaluation in practice such as a training of DNN. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that DNN is a widely used abbreviation, but deep neural networks
sounds more reader-friendly.
# Could be a very expensive evaluation in practice such as a training of DNN. | |
# Could be a very expensive evaluation in practice such as a training of deep neural networks. |
@eukaryo Could you review this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if the current comments are resolved.
This pull request has not seen any recent activity. |
This pull request has not seen any recent activity. |
@nabenabe0928 Please address @nzw0301's comments. |
This pull request has not seen any recent activity. |
This pull request has not seen any recent activity. |
Motivation
As some people would like to get the best parameters that are not affected by the random noise effect, I added the guide on how to sample the expected best parameters using the
GPSampler
introduced in v3.6.0.Description of the changes
I added the description of the way to sample the best expected parameters.