Skip to content

Commit

Permalink
remove create_trial and add_trial from the example of the ask method
Browse files Browse the repository at this point in the history
  • Loading branch information
g-votte committed Feb 5, 2021
1 parent 23f5e06 commit 89c27b2
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions optuna/study.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,17 +426,10 @@ def ask(
study = optuna.create_study()
# For example, the distributions are previously defined when using `create_trial`.
distributions = {
"optimizer": optuna.distributions.CategoricalDistribution(["adam", "sgd"]),
"lr": optuna.distributions.LogUniformDistribution(0.0001, 0.1),
}
trial = optuna.trial.create_trial(
params={"optimizer": "adam", "lr": 0.0001},
distributions=distributions,
value=0.5,
)
study.add_trial(trial)
# You can pass the distributions previously defined.
trial = study.ask(fixed_distributions=distributions)
Expand Down

0 comments on commit 89c27b2

Please sign in to comment.