-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix bugs in kurobako/solver/optuna.py #19
Conversation
kurobako/solver/optuna.py
Outdated
@@ -11,7 +11,7 @@ | |||
from kurobako import problem | |||
from kurobako import solver | |||
|
|||
_optuna_logger = optuna.logging.get_logger(__name__) | |||
_optuna_logger = optuna.logging.get_logger("optuna.study.study") |
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 this change really needed?
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.
Thanks for the PR. I am wondering if Study._log_completed_trial
could be used. Could you explain the change a little more?
kurobako/solver/optuna.py
Outdated
_optuna_logger.setLevel(optuna.logging.INFO) | ||
console = logging.StreamHandler() | ||
_optuna_logger.addHandler(console) |
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.
Could you explain the necessity of this change?
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.
In my understanding, handlers and log levels are usually set in the user code, not library code.
I don't think it is a good practice to show log messages.
I privately discuss above with @contramundum53 and @sile. As a result, we have decided to generate a log in our own format for the completed trials in this PR. The reason are
|
We reverted changes about |
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.
Thanks, LGTM!
Several bugs were present in
kurobako/solver/optuna.py
that resulted in errors when used with nontrivial pruners.trial.last_step
is undefined whentrial
is not aFrozenTrial
.self._study._log_completed_trial
requries aFrozenTrial
, but aTrial
is passedThese bugs are fixed in this PR.