From 7a5fb6942db52d1738a70f39756083a11b4cdef7 Mon Sep 17 00:00:00 2001 From: porink0424 Date: Wed, 14 Feb 2024 12:25:05 +0900 Subject: [PATCH 1/3] Add Optuna Dashboard section to docs --- docs/source/index.rst | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/docs/source/index.rst b/docs/source/index.rst index e99392100b..6a6c276e8d 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -79,6 +79,58 @@ optimization *studies*. study = optuna.create_study() # Create a new study. study.optimize(objective, n_trials=100) # Invoke optimization of the objective function. +Web Dashboard +------------- + +`Optuna Dashboard `_ is a real-time web dashboard for Optuna. +You can check the optimization history, hyperparameter importance, etc. in graphs and tables. +You don't need to create a Python script to call `Optuna's visualization `_ functions. +Feature requests and bug reports are welcome! + +.. image:: https://user-images.githubusercontent.com/5564044/204975098-95c2cb8c-0fb5-4388-abc4-da32f56cb4e5.gif + +``optuna-dashboard`` can be installed via pip: + +.. code-block:: bash + + $ pip install optuna-dashboard + +.. TIP:: + + Please check out the convenience of Optuna Dashboard using the sample code below. + +Sample code to launch Optuna Dashboard +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Save the following code as ``optimize_toy.py``. + +.. code-block:: python + + import optuna + + + def objective(trial): + x1 = trial.suggest_float("x1", -100, 100) + x2 = trial.suggest_float("x2", -100, 100) + return x1 ** 2 + 0.01 * x2 ** 2 + + + study = optuna.create_study(storage="sqlite:///db.sqlite3") # Create a new study with database. + study.optimize(objective, n_trials=100) + +Then try the commands below: + +.. code-block:: bash + + # Run the study specified above + $ python optimize_toy.py + + # Launch the dashboard based on the storage `sqlite:///db.sqlite3` + $ optuna-dashboard sqlite:///db.sqlite3 + ... + Listening on http://localhost:8080/ + Hit Ctrl-C to quit. + Communication ------------- From 3e3f28715a8bd5b79f64a25791f62069ebb16ddf Mon Sep 17 00:00:00 2001 From: porink0424 Date: Wed, 14 Feb 2024 13:40:42 +0900 Subject: [PATCH 2/3] Improve format matters according to suggestions --- docs/source/index.rst | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index 6a6c276e8d..690d33e605 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -91,13 +91,13 @@ Feature requests and bug reports are welcome! ``optuna-dashboard`` can be installed via pip: -.. code-block:: bash +.. code-block:: console - $ pip install optuna-dashboard + $ pip install optuna-dashboard .. TIP:: - Please check out the convenience of Optuna Dashboard using the sample code below. + Please check out the convenience of Optuna Dashboard using the sample code below. Sample code to launch Optuna Dashboard ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -106,30 +106,30 @@ Save the following code as ``optimize_toy.py``. .. code-block:: python - import optuna + import optuna - def objective(trial): - x1 = trial.suggest_float("x1", -100, 100) - x2 = trial.suggest_float("x2", -100, 100) - return x1 ** 2 + 0.01 * x2 ** 2 + def objective(trial): + x1 = trial.suggest_float("x1", -100, 100) + x2 = trial.suggest_float("x2", -100, 100) + return x1 ** 2 + 0.01 * x2 ** 2 - study = optuna.create_study(storage="sqlite:///db.sqlite3") # Create a new study with database. - study.optimize(objective, n_trials=100) + study = optuna.create_study(storage="sqlite:///db.sqlite3") # Create a new study with database. + study.optimize(objective, n_trials=100) Then try the commands below: -.. code-block:: bash +.. code-block:: console - # Run the study specified above - $ python optimize_toy.py + # Run the study specified above + $ python optimize_toy.py - # Launch the dashboard based on the storage `sqlite:///db.sqlite3` - $ optuna-dashboard sqlite:///db.sqlite3 - ... - Listening on http://localhost:8080/ - Hit Ctrl-C to quit. + # Launch the dashboard based on the storage `sqlite:///db.sqlite3` + $ optuna-dashboard sqlite:///db.sqlite3 + ... + Listening on http://localhost:8080/ + Hit Ctrl-C to quit. Communication ------------- From 750c16b2925f8e634faa90df8800056c8842a270 Mon Sep 17 00:00:00 2001 From: Daichi Kato <83964523+porink0424@users.noreply.github.com> Date: Wed, 14 Feb 2024 15:10:30 +0900 Subject: [PATCH 3/3] Update docs/source/index.rst Co-authored-by: c-bata --- docs/source/index.rst | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index 690d33e605..86cf4a09a4 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -97,39 +97,7 @@ Feature requests and bug reports are welcome! .. TIP:: - Please check out the convenience of Optuna Dashboard using the sample code below. - -Sample code to launch Optuna Dashboard -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Save the following code as ``optimize_toy.py``. - -.. code-block:: python - - import optuna - - - def objective(trial): - x1 = trial.suggest_float("x1", -100, 100) - x2 = trial.suggest_float("x2", -100, 100) - return x1 ** 2 + 0.01 * x2 ** 2 - - - study = optuna.create_study(storage="sqlite:///db.sqlite3") # Create a new study with database. - study.optimize(objective, n_trials=100) - -Then try the commands below: - -.. code-block:: console - - # Run the study specified above - $ python optimize_toy.py - - # Launch the dashboard based on the storage `sqlite:///db.sqlite3` - $ optuna-dashboard sqlite:///db.sqlite3 - ... - Listening on http://localhost:8080/ - Hit Ctrl-C to quit. + Please check out the `getting started `_ section of Optuna Dashboard's official documentation. Communication -------------