当前位置: 首页>>代码示例>>Python>>正文


Python logging.SmoothedValue方法代码示例

本文整理汇总了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) 
开发者ID:roytseng-tw,项目名称:Detectron.pytorch,代码行数:23,代码来源:training_stats.py

示例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) 
开发者ID:ppengtang,项目名称:pcl.pytorch,代码行数:18,代码来源:training_stats.py

示例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 
开发者ID:ronghanghu,项目名称:seg_every_thing,代码行数:20,代码来源:training_stats.py


注:本文中的utils.logging.SmoothedValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。