當前位置: 首頁>>代碼示例>>Python>>正文


Python tensorboard_logger.configure方法代碼示例

本文整理匯總了Python中tensorboard_logger.configure方法的典型用法代碼示例。如果您正苦於以下問題:Python tensorboard_logger.configure方法的具體用法?Python tensorboard_logger.configure怎麽用?Python tensorboard_logger.configure使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tensorboard_logger的用法示例。


在下文中一共展示了tensorboard_logger.configure方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import tensorboard_logger [as 別名]
# 或者: from tensorboard_logger import configure [as 別名]
def __init__(self, log_dir):
        if not os.path.isdir(log_dir):
            # if the directory does not exist we create the directory
            os.makedirs(log_dir)
        else:                      
            # clean previous logged data under the same directory name
            self._remove(log_dir)

        # configure the project
        configure(log_dir)

        self.global_step = 0 
開發者ID:priba,項目名稱:nmp_qc,代碼行數:14,代碼來源:LogMetric.py

示例2: run

# 需要導入模塊: import tensorboard_logger [as 別名]
# 或者: from tensorboard_logger import configure [as 別名]
def run(harn):
        harn.log('Begin training')

        if False:
            # TODO: can we run this as a subprocess that dies when we die?
            # or do we need to run externally?
            # tensorboard --logdir runs
            # http://aretha:6006
            pass

        if tensorboard_logger:
            harn.log('Initializing tensorboard')
            tensorboard_logger.configure("runs/ibeis", flush_secs=2)

        if harn.use_cuda:
            harn.log('Fitting model on GPU({})'.format(harn.gpu_num))
            harn.model.cuda(harn.gpu_num)
        else:
            harn.log('Fitting model on the CPU')

        if harn.class_weights is not None:
            harn.class_weights, = harn._to_xpu(harn.class_weights)

        lr = harn.lr_scheduler(harn.epoch)
        harn.optimizer = harn.optimizer_cls(harn.model.parameters(), lr=lr)

        # train loop

        while not harn.check_termination():
            harn.train_epoch()

            if harn.vali_loader:
                harn.validation_epoch()

            harn.save_snapshot()

            harn.epoch += 1 
開發者ID:Erotemic,項目名稱:ibeis,代碼行數:39,代碼來源:fit_harness.py

示例3: __init__

# 需要導入模塊: import tensorboard_logger [as 別名]
# 或者: from tensorboard_logger import configure [as 別名]
def __init__(self, log_dir):
        # clean previous logged data under the same directory name
        self._remove(log_dir)

        # configure the project
        configure(log_dir)

        self.global_step = 0 
開發者ID:qqueing,項目名稱:DeepSpeaker-pytorch,代碼行數:10,代碼來源:logger.py

示例4: __init__

# 需要導入模塊: import tensorboard_logger [as 別名]
# 或者: from tensorboard_logger import configure [as 別名]
def __init__(self, log_dir, remove_previous_files = False):
        # clean previous logged data under the same directory name
        if remove_previous_files:
            self._remove(log_dir)

        # configure the project
        configure(log_dir)

        self.global_step = 0 
開發者ID:gitabcworld,項目名稱:skiprnn_pytorch,代碼行數:11,代碼來源:logger.py

示例5: tensorboard_log

# 需要導入模塊: import tensorboard_logger [as 別名]
# 或者: from tensorboard_logger import configure [as 別名]
def tensorboard_log(self, budget, epoch, log, logdir):
        import tensorboard_logger as tl
        worker_path = 'Train/'
        try:
            tl.log_value(worker_path + 'budget', float(budget), int(time.time()))
        except:
            tl.configure(logdir)
            tl.log_value(worker_path + 'budget', float(budget), int(time.time()))
        tl.log_value(worker_path + 'epoch', float(epoch + 1), int(time.time()))
        for name, value in log.items():
            tl.log_value(worker_path + name, float(value), int(time.time())) 
開發者ID:automl,項目名稱:Auto-PyTorch,代碼行數:13,代碼來源:train_node.py


注:本文中的tensorboard_logger.configure方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。