1- """Module for PINA Torch Optimizer"""
1+ """Module for the PINA Torch Optimizer"""
22
33try :
44 from torch .optim .lr_scheduler import LRScheduler # torch >= 2.0
1414
1515class TorchScheduler (Scheduler ):
1616 """
17- TODO
18-
19- :param Scheduler: _description_
20- :type Scheduler: _type_
17+ A wrapper class for using PyTorch schedulers.
2118 """
2219
2320 def __init__ (self , scheduler_class , ** kwargs ):
2421 """
25- TODO
22+ Initialization of the :class:`TorchScheduler` class.
2623
27- :param scheduler_class: _description_
28- :type scheduler_class: _type_
24+ :param torch.optim.LRScheduler scheduler_class: The PyTorch scheduler
25+ class.
26+ :param dict kwargs: Additional parameters passed to `scheduler_class`,
27+ see more: <https://pytorch.org/docs/stable/optim.html#algorithms>_.
2928 """
3029 check_consistency (scheduler_class , LRScheduler , subclass = True )
3130
@@ -35,10 +34,9 @@ def __init__(self, scheduler_class, **kwargs):
3534
3635 def hook (self , optimizer ):
3736 """
38- TODO
37+ Initialize the scheduler instance with the given parameters.
3938
40- :param optimizer: _description_
41- :type optimizer: _type_
39+ :param dict parameters: The parameters of the optimizer.
4240 """
4341 check_consistency (optimizer , Optimizer )
4442 self ._scheduler_instance = self .scheduler_class (
@@ -48,6 +46,9 @@ def hook(self, optimizer):
4846 @property
4947 def instance (self ):
5048 """
51- Scheduler instance.
49+ Get the scheduler instance.
50+
51+ :return: The scheduelr instance.
52+ :rtype: torch.optim.LRScheduler
5253 """
5354 return self ._scheduler_instance
0 commit comments