OptunaEstimator#
- class mergernet.estimators.automl.OptunaEstimator[source]#
Bases:
Estimator
Attributes
- _objective(trial: Trial) float [source]#
Objective function that will be optimized by oputna
- Parameters:
trial (optuna.trial.Trial) – The current optuna trial
- Returns:
The metric that will be optimized by optuna
- Return type:
- compile_model(tf_model: Model, optimizer: Optimizer, metrics: list = [], label_smoothing: float = 0.0)#
- download(config: EstimatorConfig, replace: bool = False)#
- get_dataaug_block(flip_horizontal: bool = True, flip_vertical: bool = True, rotation: Tuple[float, float] | bool = (-0.08, 0.08), zoom: Tuple[float, float] | bool = (-0.15, 0.0))#
- get_scheduler(scheduler: str, lr: float) LearningRateSchedule #
For cosine_restarts scheduler, the learning rate multiplier first decays from 1 to alpha for first_decay_steps steps. Then, a warm restart is performed. Each new warm restart runs for t_mul times more steps and with m_mul times initial learning rate as the new learning rate.
- train(*args, **kwargs) Tuple[Model, History] [source]#
Starts the optuna optimization and returns the best model trained
- Returns:
The best model trained
- Return type:
tf.keras.Model
- _abc_impl = <_abc_data object>#
- registry = <mergernet.estimators.base.EstimatorRegistry object>#
- property tf_model#