def __init__(self,<EOL>learning_rate: Union[None, float, Tuple[float, float]] = None,<EOL>learning_rate_decay: Union[DType, Tuple[DType, float]] = DecayType.NO,<EOL>learning_rate_decay_epochs: int = <NUM_LIT:0>,<EOL>learning_rate_decay_batches: int = <NUM_LIT:0>,<EOL>learning_rate_drop_div: float = <NUM_LIT>,<EOL>learning_rate_drop_patience: Optional[int] = None,<EOL>momentum: Union[None, float, Tuple[float, float]] = None,<EOL>momentum_decay: Union[DType, Tuple[DType, float]] = DecayType.NO,<EOL>momentum_decay_epochs: int = <NUM_LIT:0>,<EOL>momentum_decay_batches: int = <NUM_LIT:0>,<EOL>fit_batch_size: Union[None, int, str] = None,<EOL>fit_learning_rate: Tuple[float, float] = (<NUM_LIT>, <NUM_LIT:100>),<EOL>fit_learning_rate_div: float = <NUM_LIT>,<EOL>fit_beta: float = <NUM_LIT>,<EOL>fit_min_batches: int = <NUM_LIT:10>,<EOL>fit_max_batches: Optional[int] = None,<EOL>*args, **kwargs) -> None:
if learning_rate_decay_epochs and learning_rate_decay_batches:<EOL><INDENT>raise ConfigError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if momentum_decay_epochs and momentum_decay_batches:<EOL><INDENT>raise ConfigError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>start_val, end_val = learning_rate, None<EOL>if isinstance(learning_rate, (tuple, list)):<EOL><INDENT>start_val, end_val = learning_rate<EOL><DEDENT>dec_type, extra = learning_rate_decay, None<EOL>if isinstance(learning_rate_decay, (tuple, list)):<EOL><INDENT>dec_type, extra = learning_rate_decay<EOL><DEDENT>self._lr = start_val<EOL>num_it, self._lr_update_on_batch = learning_rate_decay_epochs, False<EOL>if learning_rate_decay_batches > <NUM_LIT:0>:<EOL><INDENT>num_it, self._lr_update_on_batch = learning_rate_decay_batches, True<EOL><DEDENT>self._lr_schedule = DecayScheduler(start_val=start_val, end_val=end_val,<EOL>num_it=num_it, dec_type=dec_type, extra=extra)<EOL>self._lr_var = self._init_learning_rate_variable()<EOL>start_val, end_val = momentum, None<EOL>if isinstance(momentum, (tuple, list)):<EOL><INDENT>start_val, end_val = momentum<EOL><DEDENT>dec_type, extra = momentum_decay, None<EOL>if isinstance(momentum_decay, (tuple, list)):<EOL><INDENT>dec_type, extra = momentum_decay<EOL><DEDENT>self._mom = start_val<EOL>num_it, self._mom_update_on_batch = momentum_decay_epochs, False<EOL>self._mom_update_on_batch = momentum_decay_batches > <NUM_LIT:0><EOL>num_it = momentum_decay_epochs if self._mom_update_on_batch else momentum_decay_batches<EOL>self._mom_schedule = DecayScheduler(start_val=start_val, end_val=end_val,<EOL>num_it=num_it, dec_type=dec_type,<EOL>extra=extra)<EOL>self._mom_var = self._init_momentum_variable()<EOL>self._learning_rate_drop_patience = learning_rate_drop_patience<EOL>self._learning_rate_drop_div = learning_rate_drop_div<EOL>self._learning_rate_cur_impatience = <NUM_LIT:0.><EOL>self._learning_rate_last_impatience = <NUM_LIT:0.><EOL>self._learning_rate_cur_div = <NUM_LIT:1.><EOL>self._fit_batch_size = fit_batch_size<EOL>self._fit_learning_rate = fit_learning_rate<EOL>self._fit_learning_rate_div = fit_learning_rate_div<EOL>self._fit_beta = fit_beta<EOL>self._fit_min_batches = fit_min_batches<EOL>self._fit_max_batches = fit_max_batches<EOL>
Initialize learning rate scheduler