In Multimetric Experiments, SigOpt searches for the Pareto Frontier; these are the parameter assignments whose metric values cannot be improved uniformly. However, it may be the case that only a subset of the Pareto Frontier is actually relevant for a given application. Some points on the Pareto Frontier may not be viable because unique business requirements force one or both metrics to meet custom criteria.
The goal of Metric Thresholds is to allow you to provide a region of metric values which will define success for you. SigOpt’s Optimizer will use this information to focus on this region with the intent of better resolving the Pareto Frontier to satisfy these stated thresholds. If you want to place thresholds on non-optimized (guardrail) metrics, see Metric Constraints.
Note: The SigOpt optimized efficient frontier is illustrated by the orange points (left), but not all solutions are relevant. By placing a threshold on the metric of inference_time (right), SigOpt can focus on sampling more promising regions.
Example: Balancing Accuracy with Speed
Neural networks have great capacity to perform well in complicated machine learning situations; however, this may come at the cost of creating a very complex model with a slow inference time. We discussed this situation in an earlier blog, and used the Metric Thresholds feature to state these practical limitations at experiment creation to direct the SigOpt search on the regions of interest.
Defining the Metric Thresholds
To assign a threshold to one or more of your metrics, specify the
threshold field in the desired Metric object when creating your experiment. You can specify a threshold for any number of metrics in your multimetric experiment.
sigopt.create_experiment( name="Multimetric optimization with a threshold", project="sigopt-examples", type="offline", parameters=[ dict( name="hidden_layer_size", type="int", bounds=dict( min=32, max=128 ) ), dict( name="activation_fn", type="categorical", categorical_values=[ "relu", "tanh" ] ) ], metrics=[ dict( name="holdout_accuracy", strategy="optimize", objective="maximize" ), dict( name="inference_time", strategy="optimize", objective="minimize", threshold=0.1 ) ], parallel_bandwidth=1, budget=30 )
Updating Metric Thresholds
Metric thresholds can be updated on the properties page of an experiment at any time while the experiment is in progress.
Notes on Feasibility
If the defined metric thresholds don’t feasibly exist anywhere in the domain, this feature will perform unpredictably. SigOpt does not know beforehand what is feasible, so setting unrealistic goals hinders our ability to exploit the information we gain to optimize towards the threshold you’ve specified. For example, if the accuracy threshold for a machine learning model is set to
984, when the actual accuracy exists between
0 and 1, this feature will assume the value
984 is actually achievable and explore the domain erratically trying to find solutions that satisfy this threshold.
When defining thresholds, it is best
- to state well-established thresholds at the start of an experiment if you have the data, or
- to update the experiment after some Runs have been completed.
- Metric thresholds can be applied to optimized metrics in Multimetric Experiments.
- Thresholds can also be applied to constraint metrics.
Multimetric OptimizationMetric Constraints