(self, f_name, metric, score, show_msg=True)
Ckpt saver
            f_name - <str> the name phnof ckpt file (w/o prefix) to store, overwrite if existed
            score  - <float> The value of metric used to evaluate model
Ckpt saver
            f_name - <str> the name phnof ckpt file (w/o prefix) to store, overwrite if existed
            score  - <float> The value of metric used to evaluate model
Ckpt saver f_name - <str > the name phnof ckpt file ( w / o prefix ) to store overwrite if existed score - <float > The value of metric used to evaluate model
def save_checkpoint(self, f_name, metric, score, show_msg=True):
        '''' 
        Ckpt saver
            f_name - <str> the name phnof ckpt file (w/o prefix) to store, overwrite if existed
            score  - <float> The value of metric used to evaluate model
        '''
        ckpt_path = os.path.join(self.ckpdir, f_name)
        full_dict = {
            "model": self.model.state_dict(),
            "optimizer": self.optimizer.get_opt_state_dict(),
            "global_step": self.step,
            metric: score
        }
        # Additional modules to save
        # if self.amp:
        #    full_dict['amp'] = self.amp_lib.state_dict()
        if self.emb_decoder is not None:
            full_dict['emb_decoder'] = self.emb_decoder.state_dict()

        torch.save(full_dict, ckpt_path)
        if show_msg:
            self.verbose("Saved checkpoint (step = {}, {} = {:.2f}) and status @ {}".
                         format(human_format(self.step), metric, score, ckpt_path))
def save_checkpoint ( self , f_name , metric , score , show_msg = True ) : ckpt_path = os . path . join ( self . ckpdir , f_name ) full_dict = { "model" : self . model . state_dict ( ) , "optimizer" : self . optimizer . get_opt_state_dict ( ) , "global_step" : self . step , metric : score } # Additional modules to save # if self.amp: #    full_dict['amp'] = self.amp_lib.state_dict() if self . emb_decoder is not None : full_dict [ 'emb_decoder' ] = self . emb_decoder . state_dict ( ) torch . save ( full_dict , ckpt_path ) if show_msg : self . verbose ( "Saved checkpoint (step = {}, {} = {:.2f}) and status @ {}" . format ( human_format ( self . step ) , metric , score , ckpt_path ) )