ls_mlkit.util.scheduler module¶
- class ls_mlkit.util.scheduler.ObjectAttrsScheduler(obj: object, attr_names: list[str], total: int, warmup_steps: int = None, warmup_ratio: float = 0, strategy: SchedulerType = SchedulerType.CONSTANT_WITH_WARMUP, setter_methods: dict[str, Callable] = None, getter_methods: dict[str, Callable] = None)[source]¶
Bases:
object
- class ls_mlkit.util.scheduler.Scheduler(info: dict[str, dict[str, Any]], total: int)[source]¶
Bases:
object- get(key=None)[source]¶
Get the current value of the scheduler
- Parameters:
key (str, optional) – The key of the scheduler to get. If None, return the entire scheduler info. Defaults to None.
- Returns:
The entire scheduler info or the value of the scheduler for the given key
- Return type:
dict[str, Any] or Any
- class ls_mlkit.util.scheduler.SchedulerType(*values)[source]¶
Bases:
Enum- CONSTANT_WITH_WARMUP = 'constant_with_warmup'¶
- COSINE_DECAY_WITH_WARMUP = 'cosine_decay_with_warmup'¶
- EXPONENTIAL_DECAY_WITH_WARMUP = 'exponential_decay_with_warmup'¶
- LINEAR_DECAY_WITH_WARMUP = 'linear_decay_with_warmup'¶