detectron2.solver package

detectron2.solver.build_lr_scheduler(cfg: detectron2.config.config.CfgNode, optimizer: torch.optim.optimizer.Optimizer) → torch.optim.lr_scheduler._LRScheduler[source]

Build a LR scheduler from config.

detectron2.solver.build_optimizer(cfg: detectron2.config.config.CfgNode, model: torch.nn.modules.module.Module) → torch.optim.optimizer.Optimizer[source]

Build an optimizer from config.

class detectron2.solver.WarmupCosineLR(optimizer: torch.optim.optimizer.Optimizer, max_iters: int, warmup_factor: float = 0.001, warmup_iters: int = 1000, warmup_method: str = 'linear', last_epoch: int = -1)[source]

Bases: torch.optim.lr_scheduler._LRScheduler

get_lr() → List[float][source]
class detectron2.solver.WarmupMultiStepLR(optimizer: torch.optim.optimizer.Optimizer, milestones: List[int], gamma: float = 0.1, warmup_factor: float = 0.001, warmup_iters: int = 1000, warmup_method: str = 'linear', last_epoch: int = -1)[source]

Bases: torch.optim.lr_scheduler._LRScheduler

get_lr() → List[float][source]