本文整理汇总了Python中utils.logging.SmoothedValue方法的典型用法代码示例。如果您正苦于以下问题:Python logging.SmoothedValue方法的具体用法?Python logging.SmoothedValue怎么用?Python logging.SmoothedValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils.logging
的用法示例。
在下文中一共展示了logging.SmoothedValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from utils import logging [as 别名]
# 或者: from utils.logging import SmoothedValue [as 别名]
def __init__(self, misc_args, log_period=20, tensorboard_logger=None):
# Output logging period in SGD iterations
self.misc_args = misc_args
self.LOG_PERIOD = log_period
self.tblogger = tensorboard_logger
self.tb_ignored_keys = ['iter', 'eta']
self.iter_timer = Timer()
# Window size for smoothing tracked values (with median filtering)
self.WIN_SZ = 20
def create_smoothed_value():
return SmoothedValue(self.WIN_SZ)
self.smoothed_losses = defaultdict(create_smoothed_value)
self.smoothed_metrics = defaultdict(create_smoothed_value)
self.smoothed_total_loss = SmoothedValue(self.WIN_SZ)
# For the support of args.iter_size
self.inner_total_loss = []
self.inner_losses = defaultdict(list)
if cfg.FPN.FPN_ON:
self.inner_loss_rpn_cls = []
self.inner_loss_rpn_bbox = []
self.inner_metrics = defaultdict(list)
示例2: __init__
# 需要导入模块: from utils import logging [as 别名]
# 或者: from utils.logging import SmoothedValue [as 别名]
def __init__(self, misc_args, log_period=20, tensorboard_logger=None):
# Output logging period in SGD iterations
self.misc_args = misc_args
self.LOG_PERIOD = log_period
self.tblogger = tensorboard_logger
self.tb_ignored_keys = ['iter', 'eta']
self.iter_timer = Timer()
# Window size for smoothing tracked values (with median filtering)
self.WIN_SZ = 20
def create_smoothed_value():
return SmoothedValue(self.WIN_SZ)
self.smoothed_losses = defaultdict(create_smoothed_value)
self.smoothed_total_loss = SmoothedValue(self.WIN_SZ)
# For the support of args.iter_size
self.inner_total_loss = []
self.inner_losses = defaultdict(list)
示例3: __init__
# 需要导入模块: from utils import logging [as 别名]
# 或者: from utils.logging import SmoothedValue [as 别名]
def __init__(self, model):
# Window size for smoothing tracked values (with median filtering)
self.WIN_SZ = 20
# Output logging period in SGD iterations
self.LOG_PERIOD = 20
self.smoothed_losses_and_metrics = {
key: SmoothedValue(self.WIN_SZ)
for key in model.losses + model.metrics
}
self.losses_and_metrics = {
key: 0
for key in model.losses + model.metrics
}
self.smoothed_total_loss = SmoothedValue(self.WIN_SZ)
self.smoothed_mb_qsize = SmoothedValue(self.WIN_SZ)
self.iter_total_loss = np.nan
self.iter_timer = Timer()
self.model = model