This PR adds support for interactive explorations where the range of varying parameters can be updated, or their values fixed. For example:
var1 = VaryingParameter("x0", -50.0, 5.0)
var2 = VaryingParameter("x1", -5.0, 15.0)
obj = Objective("f", minimize=False)
generator = AxSingleFidelityGenerator(
varying_parameters=[var1, var2],
objectives=[obj],
fit_out_of_design=True,
)
evaluator = FunctionEvaluator(function=eval_func_sf)
exploration = Exploration(
generator=generator,
evaluator=evaluator,
sim_workers=2,
)
# Run 5 evals with default parameters
exploration.run(n_evals=5)
# Change range of x0 and run 10 evals
var1.update_range(-20., 0.)
generator.update_parameter(var1)
exploration.run(n_evals=10)
# Fix value of x0 and run 5 evals
var1.fix_value(-9)
generator.update_parameter(var1)
exploration.run(n_evals=5)
# Free value of x0 and run 5 evals
var1.free_value()
generator.update_parameter(var1)
exploration.run(n_evals=5)
Currently, only the generators based on the Ax service API support updating the parameters. Support for other generators will be added in future PRs.
In order to support VaryingParameters with a fixed value, a set of fixed_features needs to be passed to Ax. This, however, is not currently possible with the Service API (unless https://github.com/facebook/Ax/pull/2015 or something similar is merged). Therefore, this PR defines a CustomAxClient derived class that modifies get_next_trial to support fixed_features.
Other changes
The CustomAxClient requires Ax>=0.3.4 (and therefore python>=3.9), which means that this PR also drops support for older Ax versions and Python 3.8.
The logic of how we create the AxClients has been simplified. Now the subclasses of the AxServiceGenerator only need to define the list of GenerationSteps, instead of creating an AxClient. This avoids code duplication.
This PR adds support for interactive explorations where the range of varying parameters can be updated, or their values fixed. For example:
Currently, only the generators based on the Ax service API support updating the parameters. Support for other generators will be added in future PRs.
In order to support VaryingParameters with a fixed value, a set of
fixed_features
needs to be passed to Ax. This, however, is not currently possible with the Service API (unless https://github.com/facebook/Ax/pull/2015 or something similar is merged). Therefore, this PR defines aCustomAxClient
derived class that modifiesget_next_trial
to supportfixed_features
.Other changes
CustomAxClient
requiresAx>=0.3.4
(and thereforepython>=3.9
), which means that this PR also drops support for older Ax versions and Python 3.8.AxClient
s has been simplified. Now the subclasses of theAxServiceGenerator
only need to define the list ofGenerationStep
s, instead of creating anAxClient
. This avoids code duplication.