Ax: [Question] How to skip the Sobol step from the generation strategy and initialize the model with existing data?

Created on 10 Oct 2019  路  3Comments  路  Source: facebook/Ax

I have some initial evaluations and I want to go straight in to GPEI steps. How can I skip the Sobol step and use my existing data to initialize the model? Thanks.

question

Most helpful comment

In the context of the Service API, you can construct a GenerationStrategy with just the GPEI generation step. The GPEI will fit on the available data from the experiment, so you will need to add your initial evaluations to the experiment as trials.

gs = GenerationStrategy(
        steps=[
            GenerationStep(model=Models.GPEI, num_trials=-1),
        ],
)
ax_client = AxClient(generation_strategy=gs)
ax.create_experiment(. . .)

# Add existing data to experiment
for parameters, metric_data in data:
  _, trial_index = ax_client.attach_trial(parameters)
  ax_client.complete_trial(trial_index, metric_data)

You can dig into the expected arguments for attach_trial() and complete_trial() here: https://ax.dev/api/service.html#ax.service.ax_client.AxClient.attach_trial

All 3 comments

In the context of the Service API, you can construct a GenerationStrategy with just the GPEI generation step. The GPEI will fit on the available data from the experiment, so you will need to add your initial evaluations to the experiment as trials.

gs = GenerationStrategy(
        steps=[
            GenerationStep(model=Models.GPEI, num_trials=-1),
        ],
)
ax_client = AxClient(generation_strategy=gs)
ax.create_experiment(. . .)

# Add existing data to experiment
for parameters, metric_data in data:
  _, trial_index = ax_client.attach_trial(parameters)
  ax_client.complete_trial(trial_index, metric_data)

You can dig into the expected arguments for attach_trial() and complete_trial() here: https://ax.dev/api/service.html#ax.service.ax_client.AxClient.attach_trial

Closing out. Feel free to reopen if you have any followup questions

https://github.com/facebook/Ax/issues/199 has another example of custom generation strategy; linking here just in case someone looking for that example checks out that issue.

Was this page helpful?
0 / 5 - 0 ratings