예제 #1
0
 def default_callbacks(self) -> List:
     callbacks = []
     callbacks.append(TrainHandler(self.config))
     callbacks.append(LogHandler(self.config))
     callbacks.append(GradientClipNorm(self.config))
     callbacks.append(Checkpoint(self.config))
     return callbacks
예제 #2
0
    def configure_callbacks(self):
        # Callback
        # by default set up LogHandler and Checkpointer
        self.checkpoint_callback = Checkpoint(self.config)
        self.add_callback(self.checkpoint_callback)

        if self.rank == 0:
            self.log_handler = TextRLLogHandler(self.config)
            self.add_callback(self.log_handler)
예제 #3
0
    def configure_callbacks(self):
        # Resume callback runs for all ranks
        self.resume_callback = Resume(self.config)
        self.add_callback(self.resume_callback)

        # For logging and inference, use rank 0 by default
        if self.rank == 0:
            self.log_callback = TrainLogger(self.config)
            self.add_callback(self.log_callback)

            self.eval_callback = Evaluation(self.config)
            self.add_callback(self.eval_callback)

            if self.config.training.console:
                self.console_callback = Console(self.config)
                self.add_callback(self.console_callback)

            self.checkpoint_callback = Checkpoint(self.config)
            self.add_callback(self.checkpoint_callback)
예제 #4
0
 def configure_callbacks(self):
     # Callback
     # by default set up LogHandler and Checkpointer
     self.checkpoint_callback = Checkpoint(self.config)
     self.add_callback(self.checkpoint_callback)