-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This makes it easier to add Sobol into the mix when running benchmarks. Reviewed By: esantorella Differential Revision: D54647122
- Loading branch information
1 parent
d0df866
commit a99117b
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
# pyre-strict | ||
|
||
from typing import Optional | ||
|
||
from ax.benchmark.benchmark_method import ( | ||
BenchmarkMethod, | ||
get_sequential_optimization_scheduler_options, | ||
) | ||
from ax.modelbridge.generation_strategy import GenerationStep, GenerationStrategy | ||
from ax.modelbridge.registry import Models | ||
from ax.service.scheduler import SchedulerOptions | ||
|
||
|
||
def get_sobol_benchmark_method( | ||
distribute_replications: bool, | ||
scheduler_options: Optional[SchedulerOptions] = None, | ||
) -> BenchmarkMethod: | ||
generation_strategy = GenerationStrategy( | ||
name="Sobol", | ||
steps=[GenerationStep(model=Models.SOBOL, num_trials=-1)], | ||
) | ||
|
||
return BenchmarkMethod( | ||
name=generation_strategy.name, | ||
generation_strategy=generation_strategy, | ||
scheduler_options=scheduler_options | ||
or get_sequential_optimization_scheduler_options(), | ||
distribute_replications=distribute_replications, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters