Skip to content

Commit 33e30f8

Browse files
committed
Remove layer-decay print
1 parent e069249 commit 33e30f8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

timm/optim/optim_factory.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
""" Optimizer Factory w/ Custom Weight Decay
22
Hacked together by / Copyright 2021 Ross Wightman
33
"""
4-
import json
4+
import logging
55
from itertools import islice
66
from typing import Optional, Callable, Tuple
77

@@ -31,6 +31,8 @@
3131
except ImportError:
3232
has_apex = False
3333

34+
_logger = logging.getLogger(__name__)
35+
3436

3537
def param_groups_weight_decay(
3638
model: nn.Module,
@@ -92,6 +94,7 @@ def param_groups_layer_decay(
9294
no_weight_decay_list: Tuple[str] = (),
9395
layer_decay: float = .75,
9496
end_layer_decay: Optional[float] = None,
97+
verbose: bool = False,
9598
):
9699
"""
97100
Parameter groups for layer-wise lr decay & weight decay
@@ -142,8 +145,9 @@ def param_groups_layer_decay(
142145
param_group_names[group_name]["param_names"].append(name)
143146
param_groups[group_name]["params"].append(param)
144147

145-
# FIXME temporary output to debug new feature
146-
print("parameter groups: \n%s" % json.dumps(param_group_names, indent=2))
148+
if verbose:
149+
import json
150+
_logger.info("parameter groups: \n%s" % json.dumps(param_group_names, indent=2))
147151

148152
return list(param_groups.values())
149153

0 commit comments

Comments
 (0)