Skip to content

Commit 0454dda

Browse files
authored
Merge pull request #69 from y0z/feature/update-readme-example
Update example in README
2 parents de22f32 + 00eff17 commit 0454dda

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ import optunahub
4343

4444

4545
def objective(trial: optuna.Trial) -> float:
46-
x = trial.suggest_float("x", 0, 1)
46+
x = trial.suggest_float("x", -5, 5)
47+
y = trial.suggest_float("y", -5, 5)
48+
return x**2 + y**2
4749

48-
return x
4950

50-
51-
mod = optunahub.load_module("samplers/simulated_annealing")
52-
study = optuna.create_study(sampler=mod.SimulatedAnnealingSampler())
53-
study.optimize(objective, n_trials=20)
51+
module = optunahub.load_module(package="samplers/auto_sampler")
52+
study = optuna.create_study(sampler=module.AutoSampler())
53+
study.optimize(objective, n_trials=10)
5454

5555
print(study.best_trial.value, study.best_trial.params)
5656
```

0 commit comments

Comments
 (0)