Exemplo n.º 1
0
    def __init__(self,
                 model_dir=None,
                 initial_iter=0,
                 tensorboard_every_n=0,
                 **_unused):

        self.tensorboard_every_n = tensorboard_every_n
        # creating new summary subfolder if it's not finetuning
        self.summary_dir = get_latest_subfolder(
            os.path.join(model_dir, 'logs'), create_new=initial_iter == 0)
        self.writer_train = None
        self.writer_valid = None

        GRAPH_CREATED.connect(self.init_writer)
        ITER_STARTED.connect(self.read_tensorboard_op)
        ITER_FINISHED.connect(self.write_tensorboard)
Exemplo n.º 2
0
 def __init__(self, is_training_action=False, **_unused):
     if not is_training_action:
         return
     GRAPH_CREATED.connect(self.make_gradients_op)
     ITER_STARTED.connect(self.add_gradients)