Skip to content

Commit ec69241

Browse files
committed
Add more comments in the notebook
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
1 parent 0071cf3 commit ec69241

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

examples/tutorials/code_5_warm_starting.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"type": "legacy",
9292
"database": {"type": "pickleddb", "host": "./current_db.pkl"},
9393
},
94-
algorithms={"tpe": {"seed": seed}},
94+
algorithms={"tpe": {"seed": seed, "n_initial_points": 10}},
9595
max_trials=20,
9696
)
9797
for seed in range(n_seeds)
@@ -113,7 +113,12 @@
113113
"type": "legacy",
114114
"database": {"type": "pickleddb", "host": "./current_db.pkl"},
115115
},
116-
algorithms={"tpe": {"seed": seed}},
116+
# NOTE: This n_initial_points is changed slightly, since it also counts the trials from
117+
# the previous experiment.
118+
# NOTE: you don't *have* to do this, it also works without it. This is just to make the
119+
# comparison a bit fairer.
120+
# Both algorithms do random search from trials 0-10, and then optimize from 10-20.
121+
algorithms={"tpe": {"seed": seed, "n_initial_points": 20}},
117122
max_trials=20,
118123
knowledge_base=KnowledgeBase(storage=previous_experiment.storage),
119124
# knowledge_base={"KnowledgeBase": {"storage": previous_experiment_storage}},

0 commit comments

Comments
 (0)