mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-07 12:01:39 +00:00
Refactored docstring to google style
This commit is contained in:
@@ -6,15 +6,17 @@ from ._metric_hook import LearningRateMetric, MetricHook
|
||||
|
||||
@HOOKS.register_module
|
||||
class LRSchedulerHook(MetricHook):
|
||||
"""Build LR scheduler
|
||||
r"""Build LR scheduler for trainer.
|
||||
|
||||
:param lr_scheduler: LR scheduler
|
||||
:param by_epoch: If `True`, the LR will be scheduled every epoch. Else, the LR will be scheduled every batch
|
||||
:type by_epoch: bool
|
||||
:param store_lr_in_state: If `True`, store the learning rate in each state, defaults to `True`
|
||||
:type store_lr_in_state: bool, optional
|
||||
:param priority: Priority in the printing, hooks with small priority will be printed in front, defaults to 1
|
||||
:type priority: int, optional
|
||||
Args:
|
||||
lr_scheduler (:class:`colossalai.nn.lr_scheduler`): The specific LR scheduler
|
||||
in range of ``colossalai.nn.lr_scheduler``, more details about ``lr_scheduler`` could be found in
|
||||
`lr_scheduler <https://github.com/hpcaitech/ColossalAI/tree/main/colossalai/nn/lr_scheduler>`_.
|
||||
by_epoch (bool): If `True`, the LR will be scheduled every epoch. Else, the LR will be scheduled every batch.
|
||||
store_lr_in_state (bool, optional): If `True`, store the learning rate in each state, defaults to `True`.
|
||||
priority (int, optional): Priority in the printing, hooks with small priority will be printed in front
|
||||
defaults to 1. If different hooks share same priority, the order of printing would
|
||||
depend on the hooks order in the hook list.
|
||||
"""
|
||||
def __init__(
|
||||
self,
|
||||
|
Reference in New Issue
Block a user