Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove fall-back to list #2353

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ax/modelbridge/generation_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,9 @@ def should_transition_to_next_node(
raise NotImplementedError(
"Cannot currently select between multiple nodes to transition to."
)
elif len(next_nodes) == 1:
return True, next_nodes[0]
else:
# Will transition to the next node in the list.
return True, None
return True, next_nodes[0]

return False, None

def generator_run_limit(self, supress_generation_errors: bool = True) -> int:
Expand Down
2 changes: 2 additions & 0 deletions ax/modelbridge/tests/test_generation_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,12 +1284,14 @@ def test_gs_with_nodes_and_blocking_criteria(self) -> None:
threshold=3,
block_gen_if_met=True,
block_transition_if_unmet=True,
transition_to="GPEI_node",
),
MinTrials(
threshold=2,
only_in_statuses=[TrialStatus.COMPLETED],
block_gen_if_met=False,
block_transition_if_unmet=True,
transition_to="GPEI_node",
),
],
)
Expand Down
4 changes: 3 additions & 1 deletion tutorials/external_generation_node.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,11 @@
" model_specs=[ModelSpec(Models.SOBOL)],\n",
" transition_criteria=[\n",
" MaxTrials(\n",
" # This specifies the maximum number of trials to generate from this node.\n",
" # This specifies the maximum number of trials to generate from this node, \n",
" # and the next node in the strategy.\n",
" threshold=5,\n",
" block_transition_if_unmet=True,\n",
" transition_to=\"RandomForest\"\n",
" )\n",
" ],\n",
" ),\n",
Expand Down