當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。