Open
Description
Question
Hi,
What is the correct way to store and load an experiment and current trial data? My goal is to enable the ability to restart an optimization from any iteration using previously stored data.
The method below using to_json_snapshot()
and load_from_json_file
does not seem to work. Attempting to load the json data into another client and calling get_best_trial()
results in an empty data error.
Thanks!
Please provide any relevant code snippet if applicable.
# Setup experiment
...
# Run N iterations of BO
for i in range(N_iter):
params, it = ax_client.suggest_parameters()
objective_value = objective(params)
ax_client.update_optimizer(it, objective_value)
# Save trial to json
json_data = ax_client.to_json_snapshot()
# Save data in each iteration
with open("./exp.json", "w") as f:
json.dump(json_data, f)
# Load experiment + data from json
ax_client_2 = AxClient()
ax_client_2.load_from_json_file("./exp.json")
# This results in: Encountered error while trying to identify the best point: Cannot identify best point if experiment contains no data.
ax_client_2.get_best_trial()
Code of Conduct
- I agree to follow this Ax's Code of Conduct
Activity