OptunaSolver currently accesses self._study._storage.set_trial_values etc. in tell(), which is private. The function set_trial_values is changed to set_trial_state_and_values in newer versions of Optuna, and those lines are also affected. We propose to use self._study.tell() instead of directly accessing self._study._storage.set_trial_values, and also make corresponding changes to ask().
Description
In OptunaSolver.ask(), replace call to self._create_new_trial() by self._study.ask().
In OptunaSolver.tell(), replace calls to self._study.sampler.after_trial(), self._study._storage.set_trial_values() and self._study._storage.set_trial_state() by self._study.tell().
Remove OptunaSolver._create_new_trial(), which will be unused.
(Handle DistributionNotFound exception in OptunaSolverFactory.specification(), which occurs when kurobako-py is not installed via pip. This was necessary for me to test this change in my local environment.)
Motivation
OptunaSolver
currently accessesself._study._storage.set_trial_values
etc. intell()
, which is private. The functionset_trial_values
is changed toset_trial_state_and_values
in newer versions of Optuna, and those lines are also affected. We propose to useself._study.tell()
instead of directly accessingself._study._storage.set_trial_values
, and also make corresponding changes toask()
.Description
OptunaSolver.ask()
, replace call toself._create_new_trial()
byself._study.ask()
.OptunaSolver.tell()
, replace calls toself._study.sampler.after_trial()
,self._study._storage.set_trial_values()
andself._study._storage.set_trial_state()
byself._study.tell()
.OptunaSolver._create_new_trial()
, which will be unused.DistributionNotFound
exception inOptunaSolverFactory.specification()
, which occurs when kurobako-py is not installed via pip. This was necessary for me to test this change in my local environment.)