otx.api.entities.optimization_parameters#

This module implements the OptimizationParameters entity.

Functions

default_progress_callback(progress[, score])

This is the default progress callback for OptimizationParameters.

default_save_model_callback()

This is the default save model callback for OptimizationParameters.

Classes

OptimizationParameters(resume, ...)

Optimization parameters.

class otx.api.entities.optimization_parameters.OptimizationParameters(resume: bool = False, update_progress: ~typing.Callable[[int, float | None], ~typing.Any] = <function default_progress_callback>, save_model: ~typing.Callable[[], None] = <function default_save_model_callback>)[source]#

Bases: object

Optimization parameters.

resume (bool): Set to True if optimization must be resume with the optimizer state;

set to False to discard the optimizer state and start with fresh optimizer

update_progress (Callable[int], None): Callback which can be used to provide updates about the progress of a task. save_model (Callable[List, None]): Callback to notify that the model weights have been changed.

This callback can be used by the task when temporary weights should be saved (for instance, at the end of an epoch). If this callback has been used to save temporary weights, those weights will be used to resume optimization if for some reason training was suspended.

save_model()#

This is the default save model callback for OptimizationParameters.

update_progress(score: float | None = None)#

This is the default progress callback for OptimizationParameters.

otx.api.entities.optimization_parameters.default_progress_callback(progress: int, score: float | None = None)[source]#

This is the default progress callback for OptimizationParameters.

otx.api.entities.optimization_parameters.default_save_model_callback()[source]#

This is the default save model callback for OptimizationParameters.