You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/index.rst
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,8 @@ Install the `optunahub`_ package.
15
15
16
16
pip install optunahub
17
17
18
-
Load the package you want from the OptunaHub registry. In the next example code, you will load the ``SimulatedAnnealingSampler`` from the `samplers/simulated_annealing <https://hub.optuna.org/samplers/simulated_annealing/>`__ package.
18
+
Load the package you want from the OptunaHub registry. In the next example code, you will load the ``AutoSampler`` from the `samplers/auto_sampler <https://hub.optuna.org/samplers/auto_sampler/>`__ package.
19
+
The details for ``AutoSampler`` can be found in `this article <https://medium.com/optuna/autosampler-automatic-selection-of-optimization-algorithms-in-optuna-1443875fd8f9>`__.
19
20
20
21
.. code-block:: python
21
22
@@ -24,15 +25,16 @@ Load the package you want from the OptunaHub registry. In the next example code,
24
25
25
26
26
27
defobjective(trial: optuna.Trial) -> float:
27
-
x = trial.suggest_float("x", 0, 1)
28
+
x = trial.suggest_float("x", -5, 5)
29
+
y = trial.suggest_float("y", -5, 5)
28
30
29
-
return x
31
+
return x**2+ y**2
30
32
31
33
32
-
mod = optunahub.load_module("samplers/simulated_annealing")
34
+
mod = optunahub.load_module("samplers/auto_sampler")
33
35
34
-
study = optuna.create_study(sampler=mod.SimulatedAnnealingSampler())
35
-
study.optimize(objective, n_trials=20)
36
+
study = optuna.create_study(sampler=mod.AutoSampler())
0 commit comments