Ask and tell interface tutorial#2422
Conversation
|
By the way, does |
Codecov Report
@@ Coverage Diff @@
## master #2422 +/- ##
==========================================
- Coverage 91.44% 91.36% -0.08%
==========================================
Files 134 135 +1
Lines 11270 11307 +37
==========================================
+ Hits 10306 10331 +25
- Misses 964 976 +12
Continue to review full report at Codecov.
|
crcrpar
left a comment
There was a problem hiding this comment.
Thank you for your great work.
I think it's better to refer to this tutorial from ask and tell methods.
- https://github.com/optuna/optuna/blob/master/optuna/study.py#L390
- https://github.com/optuna/optuna/blob/master/optuna/study.py#L467
What's your take?
|
@crcrpar Absolutely! |
|
@hvy could you also review it? |
|
I'll update the PR as suggested by @crcrpar in a few days; refer to the tutorial from Cheers, |
|
Just for the record, this is a tracking issue for ask and tell related changes #2177 |
8c38403 to
eeb6800
Compare
eeb6800 to
5340398
Compare
crcrpar
left a comment
There was a problem hiding this comment.
Basically okay. I'm not quite happy with my suggestions thus comments and it's up to you and other reviewers.
|
|
||
| .. _Apply-optuna-to-an-existing-optimization-problem-with-minimum-modifications: | ||
|
|
||
| ---------------------------------------------------------------------------- |
There was a problem hiding this comment.
nit-picking this line isn't necessary. But I like this because this line makes the structure clearer while editing.
| ---------------------------------------------------------------------------- | |
| ---------------------------------------------------------------------------- |
| # A drawback of this traditional interface is less flexibility. | ||
| # If ``objective`` requires an additional argument for ``objective``, | ||
| # you need to define your customized class for the objective as in | ||
| # `this FAQ section <../../faq.html#how-to-define-objective-functions-that-have-own-arguments>`_. | ||
| # That will make the codebase more complicated. | ||
| # The ask-and-tell interface provides a more flexible syntax to optimize hyperparameters. | ||
| # The following example of ask-and-tell interface is equivalent to the previous code block. |
There was a problem hiding this comment.
I do prefer a shorter description, but let @Crissman decide.
The following is my suggestion and not a strong suggestion.
| # A drawback of this traditional interface is less flexibility. | |
| # If ``objective`` requires an additional argument for ``objective``, | |
| # you need to define your customized class for the objective as in | |
| # `this FAQ section <../../faq.html#how-to-define-objective-functions-that-have-own-arguments>`_. | |
| # That will make the codebase more complicated. | |
| # The ask-and-tell interface provides a more flexible syntax to optimize hyperparameters. | |
| # The following example of ask-and-tell interface is equivalent to the previous code block. | |
| # This interface is not flexible enough. | |
| # For example, if ``objective`` requires additional arguments other than ``trial``, | |
| # you need to define a class as in | |
| # `How to define objective functions that have own arguments? <../../faq.html#how-to-define-objective-functions-that-have-own-arguments>`_. | |
| # The ask-and-tell interface provides a more flexible syntax to optimize hyperparameters. | |
| # The following example is equivalent to the previous code block. |
There was a problem hiding this comment.
Aside from changing that first line to explain why ask/tell is not always superior, I like @crcrpar 's shorter description. 🙇♂️
There was a problem hiding this comment.
Sorry but I don't understand your comment enough. Do you mean it's better to leave the first line "A drawback of this traditional interface is less flexibility." as is and replace the other line with my suggestion?
Co-authored-by: Masaki Kozuki <masaki.kozuki.2014@gmail.com>
Co-authored-by: Masaki Kozuki <masaki.kozuki.2014@gmail.com>
Co-authored-by: Masaki Kozuki <masaki.kozuki.2014@gmail.com>
Co-authored-by: Masaki Kozuki <masaki.kozuki.2014@gmail.com>
| # A drawback of this traditional interface is less flexibility. | ||
| # If ``objective`` requires an additional argument for ``objective``, | ||
| # you need to define your customized class for the objective as in | ||
| # `this FAQ section <../../faq.html#how-to-define-objective-functions-that-have-own-arguments>`_. | ||
| # That will make the codebase more complicated. | ||
| # The ask-and-tell interface provides a more flexible syntax to optimize hyperparameters. | ||
| # The following example of ask-and-tell interface is equivalent to the previous code block. |
There was a problem hiding this comment.
Aside from changing that first line to explain why ask/tell is not always superior, I like @crcrpar 's shorter description. 🙇♂️
Crissman
left a comment
There was a problem hiding this comment.
The separate examples structure is looking good! Let's sell the tutorial more in the API doc.
Co-authored-by: Crissman Loomis <crissman@preferred.jp>
Co-authored-by: Crissman Loomis <crissman@preferred.jp>
|
Thank you for your long reviews! I'm happy to learn this interface! |
Motivation
Optuna has introduced an awesome interface called
ask and tell. This pr aims to give a tutorial for the interface.Description of the changes
askandtellmethods. (Thanks @crcrpar for your suggestions!)