how to get plots(slice, contour) from 'ax_client_snapshot.json'?
Hello,
I am trying to plot plot_slice, contour using saved ax_client_snapshot.json. Could you help me to have plots from ax_client_snapshot.json? I used following code for the plots, however I am getting AttributeError. Is there a way to get these plots from restored_ax_client?
restored_ax_client = ( AxClient.load_from_json_file() ) model = restored_ax_client.generation_strategy.model render(plot_slice(model, param1_name, objective)) render(interact_contour(model=model, metric_name=objective))
Thank you :)
@rachelhson the basic problem is that we don't serialize fitted models. So instead of
model = restored_ax_client.generation_strategy.model
you would need to do
model = restored_ax_client.generation_strategy._curr.model(
experiment=restored_ax_client.experiment,
data=restored_ax_client.experiment.lookup_data(),
**restored_ax_client.generation_strategy._curr.model_kwargs
)
After you call restored_ax_client.get_next_trial() though, you can go back to the original way of doing it.
Thanks for your reply @danielcohenlive . This works for plotting slice model and contour.
If I use generation strategy for my model. Does it have to separately store and call to retrieve?
@rachelhson can you rephrase the question. I'm not sure what you mean by "call to retrieve". And store and call to retrieve during which operation. Thanks :)
@rachelhson I'm going to close this as it's been inactive for a long time, but you can reopen if you'd like to follow up.