intelligence.zenith_tune.tuners.general
GeneralTuner Objects
class GeneralTuner()
Base class for tuners.
BARRIER_TIMEOUT
seconds
__init__
def __init__(output_dir: str = "outputs",
study_name: str = None,
db_path: Optional[str] = None,
sampler: Optional[BaseSampler] = None,
pruner: Optional[BasePruner] = None,
auto_pruners: Optional[List[AutoPrunerBase]] = None,
maximize: bool = False,
callbacks: Optional[List[Callable]] = None) -> None
Initialize the GeneralTuner.
Arguments:
output_dirstr - The directory to store the study results. Defaults to "outputs".study_namestr - The name of the study. Defaults to None.db_pathOptional[str] - The path to the database file. Defaults to None.samplerOptional[BaseSampler] - The sampler to use. Defaults to None.prunerOptional[BasePruner] - The pruner to use. Defaults to None.auto_prunersOptional[List[AutoPrunerBase]] - List of auto pruners to monitor during execution. Defaults to None.maximizebool - Whether to maximize the objective function. Defaults to False.callbacksOptional[List[Callable]] - List of Optuna callbacks. Defaults to None.
optimize
def optimize(
objective: Callable[..., Optional[float]],
n_trials: int,
default_params: Optional[Dict[str, Any]] = None
) -> Tuple[float, Dict[str, Any]]
Optimize the given objective function using Optuna.
Arguments:
objectiveCallable[..., Optional[float]] - The objective function to optimize.n_trialsint - The number of trials to run.default_paramsOptional[Dict[str, Any]] - Default parameters to use for the first optimization.
Returns:
Tuple[float, Dict[str, Any]]: The best value and parameters found during optimization.
analyze
def analyze(plot_contour: bool = True,
plot_importances: bool = True,
plot_history: bool = True,
plot_timeline: bool = True) -> None
Analyze the optimization results.
Arguments:
plot_contourbool - Whether to plot the contour plot. Defaults to True.plot_importancesbool - Whether to plot the parameter importances. Defaults to True.plot_historybool - Whether to plot the optimization history. Defaults to True.plot_timelinebool - Whether to plot the timeline. Defaults to True.