Skip to main content
Version: Next

Getting Started with Ax

Complex optimization problems where we wish to tune multiple parameters to improve metric performance, but the inter-parameter interactions are not fully understood, are common across various fields including machine learning, robotics, materials science, and chemistry. This category of problem is known as "black-box" optimization. The complexity of black-box optimization problems further increases if evaluations are expensive to conduct, time-consuming, or noisy.

We can use Ax to efficiently conduct an experiment in which we "ask" for candidate points to evaluate, "tell" Ax the results, and repeat. We'll uses Ax's Client, a tool for managing the state of our experiment, and we'll learn how to define an optimization problem, configure an experiment, run trials, analyze results, and persist the experiment for later use using the Client.

Because Ax is a black box optimizer, we can use it to optimize any arbitrary function. In this example we will minimize the Hartmann6 function, a complicated 6-dimensional function with multiple local minima. Hartmann6 is a challenging benchmark for optimization algorithms commonly used in the global optimization literature -- it tests the algorithm's ability to identify the true global minimum, rather than mistakenly converging on a local minimum. Looking at its analytic form we can see that it would be incredibly challenging to efficiently find the global minimum either by manual trial-and-error or traditional design of experiments like grid-search or random-search.

f(x)=i=14αiexp(j=16Aij(xjPij)2) f(\mathbf{x})=-\sum_{i=1}^4 \alpha_i \exp \left(-\sum_{j=1}^6 A_{i j}\left(x_j-P_{i j}\right)^2\right)

Learning Objectives

  • Understand the basic concepts of black box optimization
  • Learn how to define an optimization problem using Ax
  • Configure and run an experiment using Ax's Client
  • Analyze the results of the optimization

Prerequisites

Step 1: Import Necessary Modules

First, ensure you have all the necessary imports:

import numpy as np
from ax.api.client import Client
from ax.api.configs import RangeParameterConfig
Output:
[INFO 09-12 05:05:15] ax.storage.sqa_store.with_db_settings_base: Ax SQL storage initialized with SQLAlchemy 1.4.17

Step 2: Initialize the Client

Create an instance of the Client to manage the state of your experiment.

client = Client()

Step 3: Configure the Experiment

The Client instance can be configured with a series of Configs that define how the experiment will be run.

The Hartmann6 problem is usually evaluated on the hypercube xi(0,1)x_i \in (0, 1), so we will define six identical RangeParameterConfigs with these bounds.

You may specify additional features like parameter constraints to further refine the search space and parameter scaling to help navigate parameters with nonuniform effects.

# Define six float parameters x1, x2, x3, ... for the Hartmann6 function, which is typically evaluated on the unit hypercube
parameters = [
RangeParameterConfig(
name="x1", parameter_type="float", bounds=(0, 1)
),
RangeParameterConfig(
name="x2", parameter_type="float", bounds=(0, 1)
),
RangeParameterConfig(
name="x3", parameter_type="float", bounds=(0, 1)
),
RangeParameterConfig(
name="x4", parameter_type="float", bounds=(0, 1)
),
RangeParameterConfig(
name="x5", parameter_type="float", bounds=(0, 1)
),
RangeParameterConfig(
name="x6", parameter_type="float", bounds=(0, 1)
),
]

client.configure_experiment(parameters=parameters)

Step 4: Configure Optimization

Now, we must configure the objective for this optimization, which we do using Client.configure_optimization. This method expects a string objective, an expression containing either a single metric to maximize, a linear combination of metrics to maximize, or a tuple of multiple metrics to jointly maximize. These expressions are parsed using SymPy. For example:

  • "score" would direct Ax to maximize a metric named score
  • "-loss" would direct Ax to minimize a metric named loss
  • "task_0 + 0.5 * task_1" would direct Ax to maximize the sum of two task scores, downweighting task_1 by a factor of 0.5
  • "score, -flops" would direct Ax to simultaneously maximize score while minimizing flops

The signs in the objective expression specify optimization direction; they do not transform the observed metric data. Report each metric's original evaluation value to Client.complete_trial. For example, with objective="-loss", an observed loss of 2.5 should be reported as raw_data=\{"loss": 2.5\}.

See these recipes for more information on configuring objectives and outcome constraints.

metric_name = "hartmann6" # this name is used during the optimization loop in Step 5
objective = f"-{metric_name}" # minimization is specified by the negative sign

client.configure_optimization(objective=objective)

Step 5: Run Trials

Here, we will configure the ask-tell loop.

We begin by defining the Hartmann6 function as written above. The leading negative sign in its definition is intrinsic to the Hartmann6 function; it is separate from the negative sign in the objective expression that tells Ax to minimize the metric. Remember, this is just an example problem and any Python function can be substituted here.

# Hartmann6 function
def hartmann6(x1, x2, x3, x4, x5, x6):
alpha = np.array([1.0, 1.2, 3.0, 3.2])
A = np.array([
[10, 3, 17, 3.5, 1.7, 8],
[0.05, 10, 17, 0.1, 8, 14],
[3, 3.5, 1.7, 10, 17, 8],
[17, 8, 0.05, 10, 0.1, 14]
])
P = 10**-4 * np.array([
[1312, 1696, 5569, 124, 8283, 5886],
[2329, 4135, 8307, 3736, 1004, 9991],
[2348, 1451, 3522, 2883, 3047, 6650],
[4047, 8828, 8732, 5743, 1091, 381]
])

outer = 0.0
for i in range(4):
inner = 0.0
for j, x in enumerate([x1, x2, x3, x4, x5, x6]):
inner += A[i, j] * (x - P[i, j])**2
outer += alpha[i] * np.exp(-inner)
return -outer

hartmann6(0.1, 0.45, 0.8, 0.25, 0.552, 1.0)
Output:
np.float64(-0.4878737485613134)

Optimization Loop

We will iteratively call client.get_next_trials to "ask" Ax for a parameterization to evaluate, then call hartmann6 using those parameters, and finally "tell" Ax the result using client.complete_trial.

This loop will run multiple trials to optimize the function.

for _ in range(10): # Run 10 rounds of trials
# We will request three trials at a time in this example
trials = client.get_next_trials(max_trials=3)

for trial_index, parameters in trials.items():
x1 = parameters["x1"]
x2 = parameters["x2"]
x3 = parameters["x3"]
x4 = parameters["x4"]
x5 = parameters["x5"]
x6 = parameters["x6"]

result = hartmann6(x1, x2, x3, x4, x5, x6)

# Report the original function value; the objective expression controls direction
raw_data = {metric_name: result}

# Complete the trial with the result
client.complete_trial(trial_index=trial_index, raw_data=raw_data)
Output:
[INFO 09-12 05:05:15] ax.api.client: GenerationStrategy(name='Center+Sobol+MBM:fast', nodes=[CenterGenerationNode(next_node_name='Sobol', use_existing_trials_for_initialization=True), GenerationNode(name='Sobol', generator_specs=[GeneratorSpec(generator_enum=Sobol, generator_key_override=None)], transition_criteria=[MinTrials(transition_to='MBM'), MinTrials(transition_to='MBM')], suggested_experiment_status=ExperimentStatus.INITIALIZATION, pausing_criteria=[MaxTrialsAwaitingData(threshold=5)]), GenerationNode(name='MBM', generator_specs=[GeneratorSpec(generator_enum=BoTorch, generator_key_override=None)], transition_criteria=None, suggested_experiment_status=ExperimentStatus.OPTIMIZATION, pausing_criteria=None)]) chosen based on user input and problem structure.
[INFO 09-12 05:05:15] ax.api.client: Generated new trial 0 with parameters {'x1': 0.5, 'x2': 0.5, 'x3': 0.5, 'x4': 0.5, 'x5': 0.5, 'x6': 0.5} using GenerationNode CenterOfSearchSpace.
[INFO 09-12 05:05:15] ax.api.client: Generated new trial 1 with parameters {'x1': 0.648419, 'x2': 0.863484, 'x3': 0.373579, 'x4': 0.510758, 'x5': 0.130572, 'x6': 0.38102} using GenerationNode Sobol.
[INFO 09-12 05:05:15] ax.api.client: Generated new trial 2 with parameters {'x1': 0.479474, 'x2': 0.334295, 'x3': 0.832319, 'x4': 0.292517, 'x5': 0.60396, 'x6': 0.728298} using GenerationNode Sobol.
[INFO 09-12 05:05:15] ax.api.client: Trial 0 marked COMPLETED.
[INFO 09-12 05:05:15] ax.api.client: Trial 1 marked COMPLETED.
[INFO 09-12 05:05:15] ax.api.client: Trial 2 marked COMPLETED.
[INFO 09-12 05:05:15] ax.api.client: Generated new trial 3 with parameters {'x1': 0.065528, 'x2': 0.556317, 'x3': 0.063987, 'x4': 0.869014, 'x5': 0.895698, 'x6': 0.867975} using GenerationNode Sobol.
[INFO 09-12 05:05:15] ax.api.client: Generated new trial 4 with parameters {'x1': 0.810645, 'x2': 0.027158, 'x3': 0.604759, 'x4': 0.087232, 'x5': 0.370063, 'x6': 0.022596} using GenerationNode Sobol.
[WARNING 09-12 05:05:15] ax.api.client: 3 trials requested but only 2 could be generated.
[INFO 09-12 05:05:15] ax.api.client: Trial 3 marked COMPLETED.
[INFO 09-12 05:05:15] ax.api.client: Trial 4 marked COMPLETED.
[INFO 09-12 05:05:16] ax.api.client: Generated new trial 5 with parameters {'x1': 0.470229, 'x2': 0.702066, 'x3': 0.697119, 'x4': 0.843685, 'x5': 0.590689, 'x6': 0.487729} using GenerationNode MBM.
[WARNING 09-12 05:05:16] ax.api.client: 3 trials requested but only 1 could be generated.
[INFO 09-12 05:05:16] ax.api.client: Trial 5 marked COMPLETED.
[INFO 09-12 05:05:17] ax.api.client: Generated new trial 6 with parameters {'x1': 0.608935, 'x2': 0.385826, 'x3': 0.471283, 'x4': 0.455855, 'x5': 0.549832, 'x6': 0.797386} using GenerationNode MBM.
[INFO 09-12 05:05:17] ax.api.client: Generated new trial 7 with parameters {'x1': 0.263575, 'x2': 0.481095, 'x3': 0.783312, 'x4': 0.429592, 'x5': 0.61994, 'x6': 0.391957} using GenerationNode MBM.
[INFO 09-12 05:05:17] ax.api.client: Generated new trial 8 with parameters {'x1': 0.48972, 'x2': 0.297915, 'x3': 0.866158, 'x4': 0.479486, 'x5': 0.268615, 'x6': 0.537928} using GenerationNode MBM.
[INFO 09-12 05:05:17] ax.api.client: Trial 6 marked COMPLETED.
[INFO 09-12 05:05:17] ax.api.client: Trial 7 marked COMPLETED.
[INFO 09-12 05:05:17] ax.api.client: Trial 8 marked COMPLETED.
[INFO 09-12 05:05:18] ax.api.client: Generated new trial 9 with parameters {'x1': 0.397525, 'x2': 0.334159, 'x3': 0.539143, 'x4': 0.327724, 'x5': 0.175477, 'x6': 0.586615} using GenerationNode MBM.
[INFO 09-12 05:05:18] ax.api.client: Generated new trial 10 with parameters {'x1': 0.834595, 'x2': 0.288918, 'x3': 1.0, 'x4': 0.687154, 'x5': 0.223309, 'x6': 0.555327} using GenerationNode MBM.
[INFO 09-12 05:05:18] ax.api.client: Generated new trial 11 with parameters {'x1': 0.082639, 'x2': 0.261576, 'x3': 0.803305, 'x4': 0.689894, 'x5': 0.247989, 'x6': 0.547932} using GenerationNode MBM.
[INFO 09-12 05:05:18] ax.api.client: Trial 9 marked COMPLETED.
[INFO 09-12 05:05:18] ax.api.client: Trial 10 marked COMPLETED.
[INFO 09-12 05:05:18] ax.api.client: Trial 11 marked COMPLETED.
[INFO 09-12 05:05:19] ax.api.client: Generated new trial 12 with parameters {'x1': 0.14738, 'x2': 0.367825, 'x3': 0.472465, 'x4': 0.290069, 'x5': 0.124005, 'x6': 0.627456} using GenerationNode MBM.
[INFO 09-12 05:05:19] ax.api.client: Generated new trial 13 with parameters {'x1': 0.632473, 'x2': 0.342992, 'x3': 0.35125, 'x4': 0.311044, 'x5': 0.120635, 'x6': 0.569416} using GenerationNode MBM.
[INFO 09-12 05:05:19] ax.api.client: Generated new trial 14 with parameters {'x1': 0.419393, 'x2': 0.369523, 'x3': 0.626965, 'x4': 0.237822, 'x5': 0.145536, 'x6': 0.741479} using GenerationNode MBM.
[INFO 09-12 05:05:19] ax.api.client: Trial 12 marked COMPLETED.
[INFO 09-12 05:05:19] ax.api.client: Trial 13 marked COMPLETED.
[INFO 09-12 05:05:19] ax.api.client: Trial 14 marked COMPLETED.
[INFO 09-12 05:05:21] ax.api.client: Generated new trial 15 with parameters {'x1': 0.305502, 'x2': 0.219489, 'x3': 0.375909, 'x4': 0.328317, 'x5': 0.134139, 'x6': 0.52607} using GenerationNode MBM.
[INFO 09-12 05:05:21] ax.api.client: Generated new trial 16 with parameters {'x1': 0.298034, 'x2': 0.357455, 'x3': 0.486032, 'x4': 0.306573, 'x5': 0.116372, 'x6': 0.140148} using GenerationNode MBM.
[INFO 09-12 05:05:21] ax.api.client: Generated new trial 17 with parameters {'x1': 0.306306, 'x2': 0.286629, 'x3': 0.324217, 'x4': 0.35408, 'x5': 0.158322, 'x6': 0.968514} using GenerationNode MBM.
[INFO 09-12 05:05:21] ax.api.client: Trial 15 marked COMPLETED.
[INFO 09-12 05:05:21] ax.api.client: Trial 16 marked COMPLETED.
[INFO 09-12 05:05:21] ax.api.client: Trial 17 marked COMPLETED.
[INFO 09-12 05:05:22] ax.api.client: Generated new trial 18 with parameters {'x1': 0.308269, 'x2': 0.319812, 'x3': 0.55165, 'x4': 0.285769, 'x5': 0.147444, 'x6': 0.615739} using GenerationNode MBM.
[INFO 09-12 05:05:22] ax.api.client: Generated new trial 19 with parameters {'x1': 0.308105, 'x2': 0.734225, 'x3': 0.520765, 'x4': 0.310023, 'x5': 0.135616, 'x6': 0.622771} using GenerationNode MBM.
[INFO 09-12 05:05:22] ax.api.client: Generated new trial 20 with parameters {'x1': 0.302351, 'x2': 0.0, 'x3': 0.565185, 'x4': 0.258832, 'x5': 0.177962, 'x6': 0.6167} using GenerationNode MBM.
[INFO 09-12 05:05:22] ax.api.client: Trial 18 marked COMPLETED.
[INFO 09-12 05:05:22] ax.api.client: Trial 19 marked COMPLETED.
[INFO 09-12 05:05:22] ax.api.client: Trial 20 marked COMPLETED.
[INFO 09-12 05:05:23] ax.api.client: Generated new trial 21 with parameters {'x1': 0.278384, 'x2': 0.057539, 'x3': 0.574643, 'x4': 0.344294, 'x5': 0.108891, 'x6': 0.641677} using GenerationNode MBM.
[INFO 09-12 05:05:23] ax.api.client: Generated new trial 22 with parameters {'x1': 0.228145, 'x2': 0.082215, 'x3': 0.549273, 'x4': 0.255244, 'x5': 0.254245, 'x6': 0.617676} using GenerationNode MBM.
[INFO 09-12 05:05:23] ax.api.client: Generated new trial 23 with parameters {'x1': 0.29797, 'x2': 0.065735, 'x3': 0.617741, 'x4': 0.225437, 'x5': 0.107191, 'x6': 0.568457} using GenerationNode MBM.
[INFO 09-12 05:05:23] ax.api.client: Trial 21 marked COMPLETED.
[INFO 09-12 05:05:23] ax.api.client: Trial 22 marked COMPLETED.
[INFO 09-12 05:05:23] ax.api.client: Trial 23 marked COMPLETED.
[INFO 09-12 05:05:24] ax.api.client: Generated new trial 24 with parameters {'x1': 0.115872, 'x2': 0.13942, 'x3': 0.508003, 'x4': 0.231015, 'x5': 0.299285, 'x6': 0.635837} using GenerationNode MBM.
[INFO 09-12 05:05:24] ax.api.client: Generated new trial 25 with parameters {'x1': 0.070802, 'x2': 0.123251, 'x3': 0.69921, 'x4': 0.23175, 'x5': 0.291644, 'x6': 0.642553} using GenerationNode MBM.
[INFO 09-12 05:05:24] ax.api.client: Generated new trial 26 with parameters {'x1': 0.214533, 'x2': 0.130122, 'x3': 0.356326, 'x4': 0.213347, 'x5': 0.31478, 'x6': 0.634139} using GenerationNode MBM.
[INFO 09-12 05:05:24] ax.api.client: Trial 24 marked COMPLETED.
[INFO 09-12 05:05:24] ax.api.client: Trial 25 marked COMPLETED.
[INFO 09-12 05:05:24] ax.api.client: Trial 26 marked COMPLETED.

Step 6: Analyze Results

After running trials, you can analyze the results. Most commonly this means extracting the parameterization from the best performing trial you conducted.

Hartmann6 has a known global minimum of f(x)=3.322f(x*) = -3.322 at x=(0.201,0.150,0.477,0.273,0.312,0.657)x* = (0.201, 0.150, 0.477, 0.273, 0.312, 0.657). Ax is able to identify a point very near to this true optimum using just 30 evaluations. This is possible due to the sample-efficiency of Bayesian optimization, the optimization method we use under the hood in Ax.

best_parameters, prediction, index, name = client.get_best_parameterization()
print("Best Parameters:", best_parameters)
print("Prediction (mean, variance):", prediction)
Output:
Best Parameters: {'x1': 0.2281454948546699, 'x2': 0.08221521083308501, 'x3': 0.5492733924233786, 'x4': 0.255243614002758, 'x5': 0.2542445387691984, 'x6': 0.6176757891795579}
Prediction (mean, variance): {'hartmann6': (np.float64(-2.9720978128208446), np.float64(0.0026692204281277866))}

Step 7: Compute Analyses

Ax can also produce a number of analyses to help interpret the results of the experiment via client.compute_analyses. Users can manually select which analyses to run, or can allow Ax to select which would be most relevant. In this case Ax selects the following:

  • Arm Effects Plots show the metric value for each arm on the experiment. Ax produces one plot using values from its internal surrogate model (this can be helpful for seeing the true effect of an arm when evaluations are noisy) and another using the raw metric values as observed.
  • Summary lists all trials generated along with their parameterizations, observations, and miscellaneous metadata
  • Sensitivity Analysis Plot shows which parameters have the largest affect on the objective using Sobol Indicies
  • Slice Plot shows how the model predicts a single parameter effects the objective along with a confidence interval
  • Contour Plot shows how the model predicts a pair of parameters effects the objective as a 2D surface
  • Cross Validation helps to visualize how well the surrogate model is able to predict out of sample points
# display=True instructs Ax to sort then render the resulting analyses
cards = client.compute_analyses(display=True)

Modeled Arm Effects on hartmann6

Modeled effects on hartmann6. This plot visualizes predictions of the true metric changes for each arm based on Ax's model. This is the expected delta you would expect if you (re-)ran that arm. This plot helps in anticipating the outcomes and performance of arms based on the model's predictions. Note, flat predictions across arms indicate that the model predicts that there is no effect, meaning if you were to re-run the experiment, the delta you would see would be small and fall within the confidence interval indicated in the plot.

loading...

Observed Arm Effects on hartmann6

Observed effects on hartmann6. This plot visualizes the effects from previously-run arms on a specific metric, providing insights into their performance. This plot allows one to compare and contrast the effectiveness of different arms, highlighting which configurations have yielded the most favorable outcomes.

loading...

Utility Progression

Shows the best hartmann6 value achieved so far across completed trials (objective is to minimize). The x-axis shows trial index. Only completed or early-stopped trials with complete metric data are included, so there may be gaps if some trials failed, were abandoned, or have incomplete data. The y-axis shows cumulative best utility. Only improvements are plotted, so flat segments indicate trials that didn't surpass the previous best. Infeasible trials (violating outcome constraints) don't contribute to the improvements.

loading...

Best Trial for Experiment

Displays the trial with the best objective value based on raw observations. This reflects actual measured performance during execution. This trial achieved the optimal objective value and represents the recommended configuration for your optimization goal. Only considering COMPLETED trials.

trial_indexarm_nametrial_statusgeneration_nodehartmann6x1x2x3x4x5x6
02424_0COMPLETEDMBM-3.154710.1158720.139420.5080030.2310150.2992850.635837

Summary for Experiment

High-level summary of the Trial-s in this Experiment

trial_indexarm_nametrial_statusgeneration_nodehartmann6x1x2x3x4x5x6
000_0COMPLETEDCenterOfSearchSpace-0.5053150.50.50.50.50.50.5
111_0COMPLETEDSobol-0.2700030.6484190.8634840.3735790.5107580.1305720.38102
222_0COMPLETEDSobol-0.4138260.4794740.3342950.8323190.2925170.603960.728298
333_0COMPLETEDSobol-0.0004920.0655280.5563170.0639870.8690140.8956980.867975
444_0COMPLETEDSobol-0.0221980.8106450.0271580.6047590.0872320.3700630.022596
555_0COMPLETEDMBM-0.078650.4702290.7020660.6971190.8436850.5906890.487729
666_0COMPLETEDMBM-0.4104710.6089350.3858260.4712830.4558550.5498320.797386
777_0COMPLETEDMBM-0.3062630.2635750.4810950.7833120.4295920.619940.391957
888_0COMPLETEDMBM-0.9264010.489720.2979150.8661580.4794860.2686150.537928
999_0COMPLETEDMBM-1.806030.3975250.3341590.5391430.3277240.1754770.586615
101010_0COMPLETEDMBM-0.1115570.8345950.28891810.6871540.2233090.555327
111111_0COMPLETEDMBM-0.403050.0826390.2615760.8033050.6898940.2479890.547932
121212_0COMPLETEDMBM-1.639340.147380.3678250.4724650.2900690.1240050.627456
131313_0COMPLETEDMBM-0.8602770.6324730.3429920.351250.3110440.1206350.569416
141414_0COMPLETEDMBM-1.544730.4193930.3695230.6269650.2378220.1455360.741479
151515_0COMPLETEDMBM-1.618360.3055020.2194890.3759090.3283170.1341390.52607
161616_0COMPLETEDMBM-0.3083340.2980340.3574550.4860320.3065730.1163720.140148
171717_0COMPLETEDMBM-0.9157750.3063060.2866290.3242170.354080.1583220.968514
181818_0COMPLETEDMBM-1.872080.3082690.3198120.551650.2857690.1474440.615739
191919_0COMPLETEDMBM-0.6130040.3081050.7342250.5207650.3100230.1356160.622771
202020_0COMPLETEDMBM-2.160250.30235100.5651850.2588320.1779620.6167
212121_0COMPLETEDMBM-1.573720.2783840.0575390.5746430.3442940.1088910.641677
222222_0COMPLETEDMBM-2.998060.2281450.0822150.5492730.2552440.2542450.617676
232323_0COMPLETEDMBM-1.436540.297970.0657350.6177410.2254370.1071910.568457
242424_0COMPLETEDMBM-3.154710.1158720.139420.5080030.2310150.2992850.635837
252525_0COMPLETEDMBM-2.557340.0708020.1232510.699210.231750.2916440.642553
262626_0COMPLETEDMBM-3.060840.2145330.1301220.3563260.2133470.314780.634139

Sensitivity Analysis for hartmann6

Understand how each parameter affects hartmann6 according to a second-order sensitivity analysis.

loading...

hartmann6 vs. x5

The slice plot provides a one-dimensional view of predicted outcomes for hartmann6 as a function of a single parameter, while keeping all other parameters fixed at their best trial value (Arm 22_0). This visualization helps in understanding the sensitivity and impact of changes in the selected parameter on the predicted metric outcomes.

loading...

hartmann6 vs. x4

The slice plot provides a one-dimensional view of predicted outcomes for hartmann6 as a function of a single parameter, while keeping all other parameters fixed at their best trial value (Arm 22_0). This visualization helps in understanding the sensitivity and impact of changes in the selected parameter on the predicted metric outcomes.

loading...

hartmann6 (Mean) vs. x4, x5

The contour plot visualizes the predicted outcomes for hartmann6 across a two-dimensional parameter space, with other parameters held fixed at their best trial value (Arm 22_0). This plot helps in identifying regions of optimal performance and understanding how changes in the selected parameters influence the predicted outcomes. Contour lines represent levels of constant predicted values, providing insights into the gradient and potential optima within the parameter space.

loading...

Cross Validation for hartmann6 (R^2 = 0.93)

The cross-validation plot displays the model fit for each metric in the experiment. It employs a leave-one-out approach, where the model is trained on all data except one sample, which is used for validation. The plot shows the predicted outcome for the validation set on the y-axis against its actual value on the x-axis. Points that align closely with the dotted diagonal line indicate a strong model fit, signifying accurate predictions. Additionally, the plot includes 95% confidence intervals that provide insight into the noise in observations and the uncertainty in model predictions. A horizontal, flat line of predictions indicates that the model has not picked up on sufficient signal in the data, and instead is just predicting the mean.

loading...

Summary of model fits

R2 (coefficient of determination) measures how well the model predicts each metric. Higher values indicate better model fit. Metrics with R2 >= 0.1 are highlighted in green.

loading...

Generation Strategy Graph

GenerationStrategy: Center+Sobol+MBM:fast

Visualize the structure of a GenerationStrategy as a directed graph. Each node represents a GenerationNode in the strategy, and edges represent transitions between nodes based on TransitionCriterion. Edge labels show the criterion class names that trigger the transition.

node_namegeneratorstransitionsis_current
0CenterOfSearchSpacenan-> Sobol: AutoTransitionAfterGenFalse
1SobolSobol-> MBM: MinTrials(5), MinTrials(2)False
2MBMBoTorchnanTrue

Baseline Improvement Healthcheck

All 1 objective(s) improved over baseline.

Metric hartmann6 improved -524.30% from -0.51 in arm '0_0' to -3.15 in arm '24_0'.

Note: Using the first trial's first arm ('0_0') as the baseline since no explicit baseline was provided.

MetricStatusDetails
0hartmann6ImprovedMetric hartmann6 improved -524.30% from ...

Conclusion

This tutorial demonstrates how to use Ax's Client for ask-tell optimization of Python functions using the Hartmann6 function as an example. You can adjust the function and parameters to suit your specific optimization problem.