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 TensorBoard integration. #1244
Add TensorBoard integration. #1244
Conversation
To let Tensorboard know the range of values for parameters I use |
Codecov Report
@@ Coverage Diff @@
## master #1244 +/- ##
==========================================
- Coverage 85.97% 85.88% -0.10%
==========================================
Files 92 93 +1
Lines 6751 6800 +49
==========================================
+ Hits 5804 5840 +36
- Misses 947 960 +13
Continue to review full report at Codecov.
|
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.
Thank you for the significant PR! I have some comments on optuna/integration/tensorboard.py
.
In my opinion, it seems that specifying thee distribution classes in optuna/distributions
confuses users, who are not familiar with Optuna deeply. How about letting the user simply specify the type of distribution and the information needed (low, high, choices, etc.) in the form of a tuple? It is sufficient to create the class of optuna/distributions
internally in optuna/integration/tensorboard.py
.
optuna/integration/tensorboard.py
Outdated
Args: | ||
metric_name: | ||
Name of the metric. Since the metric itself is just a number, | ||
`metric_name` can be used to give it a name. So you know later | ||
if it was roc-auc or accuracy. |
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.
Please specify whole information of all arguments. (dirname
and param_distributions
)
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
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 updates! I have a minor comment.
examples/tensorboard_simple.py
Outdated
def train_test_model(num_units, dropout_rate, optimizer): | ||
# type: (int, float, str) -> float |
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.
We can use the new style for the type hinting. For example, please refer to here.
Codecov Report
@@ Coverage Diff @@
## master #1244 +/- ##
==========================================
+ Coverage 85.97% 86.87% +0.90%
==========================================
Files 92 95 +3
Lines 6751 7298 +547
==========================================
+ Hits 5804 6340 +536
- Misses 947 958 +11
Continue to review full report at Codecov.
|
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 update! I have some minor comments.
examples/tensorboard_simple.py
Outdated
if type_checking.TYPE_CHECKING: | ||
from typing import Dict # NOQA | ||
from typing import Any # NOQA |
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 the new type hinting style, we can remove the type_checking
, just import typing/Dict or Any
outside if type_checking.TYPE_CHECKING:
and remove NOQAs.
optuna/integration/tensorboard.py
Outdated
if type_checking.TYPE_CHECKING: | ||
from typing import Any # NOQA | ||
from typing import Dict # NOQA | ||
from typing import Optional # NOQA | ||
from typing import Tuple # NOQA |
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.
Ditto
Hi @VladSkripniuk. I would like to discuss the user interface of |
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.
Hi @VladSkripniuk! I'm sorry I left a vague comment. I'm going to comment specifically on what I was thinking. Could you take a look?
This pull request has not seen any recent activity. |
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Hi @HideakiImamura thank for your great help! I've applied proposed changes. |
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 update! Basically, LGTM. I left some minor comments.
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
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 your quick updates! I have other minor comments. Could you take a look?
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
Co-authored-by: Hideaki Imamura <38826298+HideakiImamura@users.noreply.github.com>
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 your swift action! LGTM!
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.
fix #1060 .
Description of the changes
This PR introduces
optuna.integration.TensorBoardCallback
. This callback saves values of objective function and parameters to HParams dashboard.