Skip to content

Commit a1b3412

Browse files
Lena Kashtelyanfacebook-github-bot
authored andcommitted
Move all step-based GS functionality to nodes (#94)
Summary: X-link: facebook/Ax#4746 X-link: facebook/Ax#4731 A lot going on here: 1. Make `GenerationStep` a factory for `GenerationNode` by replacing its `__init__(self, ...)` constructor (which would have to return a `GStep`) with a `__new__(cls, ...)` construtor, which can return a `GNode` (magic, thanks Devmate!) 2. Adapt storage: stop storing steps and just treat them as nodes. No step-only fields will be saved going forward. Backward compatibility is handled though. 3. Change a bazillion tests and checks in downstream applications. NOTE: need to remember next steps here: https://www.internalfb.com/diff/D86066476?dst_version_fbid=732904879835890&transaction_fbid=1400151778204976, cc mgarrard sorrybigdiff Reviewed By: mgarrard Differential Revision: D80128678
1 parent 511b965 commit a1b3412

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests/test_tuning.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,18 @@ def test_warm_starting_trials_produces_the_right_number_of_sobol_and_bayesian_tr
344344
)
345345

346346
value_counter = trial_results["generation_node"].value_counts().to_dict()
347-
sobol_count = value_counter["GenerationStep_0"]
348-
botorch_count = value_counter["GenerationStep_1"]
349-
347+
sobol_key = (
348+
"GenerationStep_0_Sobol"
349+
if "GenerationStep_0_Sobol" in value_counter
350+
else "GenerationStep_0"
351+
)
352+
sobol_count = value_counter[sobol_key]
353+
botorch_key = (
354+
"GenerationStep_1_BoTorch"
355+
if "GenerationStep_1_BoTorch" in value_counter
356+
else "GenerationStep_1"
357+
)
358+
botorch_count = value_counter[botorch_key]
350359
expected_botorch = total_trials - n_warmup_random_trials - 1
351360
assert (
352361
len(trial_results) == total_trials

0 commit comments

Comments
 (0)