File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
pytorch_lightning/callbacks Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -102,10 +102,10 @@ def __init__(
102102 if isinstance (swa_epoch_start , float ) and not (0 <= swa_epoch_start <= 1 ):
103103 raise MisconfigurationException (err_msg )
104104
105- _wrong_type = not isinstance (swa_lrs , (float , list ))
106- _wrong_float = isinstance (swa_lrs , float ) and swa_lrs <= 0
107- _wrong_list = isinstance (swa_lrs , list ) and not all (lr > 0 and isinstance (lr , float ) for lr in swa_lrs )
108- if (swa_lrs is not None and (_wrong_type or _wrong_float or _wrong_list )):
105+ wrong_type = not isinstance (swa_lrs , (float , list ))
106+ wrong_float = isinstance (swa_lrs , float ) and swa_lrs <= 0
107+ wrong_list = isinstance (swa_lrs , list ) and not all (lr > 0 and isinstance (lr , float ) for lr in swa_lrs )
108+ if (swa_lrs is not None and (wrong_type or wrong_float or wrong_list )):
109109 raise MisconfigurationException ("The `swa_lrs` should be a positive float or a list of positive float." )
110110
111111 if avg_fn is not None and not isinstance (avg_fn , Callable ):
You can’t perform that action at this time.
0 commit comments