src/models/utils.py
def model_log(self, model, optimizer, metric, current_epoch, loss=None):
        """Save checkpoint if step size conditions meet, and update
        best checkpoint based on metric and mode.
        """
        if self.model_log_state:
            if current_epoch == 0:
                self.best_metric = metric['testing']

            # Check if the current model is the best
            self._save_best(model, optimizer, metric, current_epoch, loss)

            if not current_epoch % self.step_size:
                self._save_current(model, optimizer, metric, current_epoch,
                                   loss)
Save checkpoint if step size conditions meet, and update
        best checkpoint based on metric and mode.
        
Save checkpoint if step size conditions meet, and update
best checkpoint based on metric and mode.
Save checkpoint if step size conditions meet and update best checkpoint based on metric and mode .
def model_log(self, model, optimizer, metric, current_epoch, loss=None):
        if self.model_log_state:
            if current_epoch == 0:
                self.best_metric = metric['testing']
            self._save_best(model, optimizer, metric, current_epoch, loss)
            if not current_epoch % self.step_size:
                self._save_current(model, optimizer, metric, current_epoch,
                                   loss)
def model_log ( self , model , optimizer , metric , current_epoch , loss = None ) : if self . model_log_state : if current_epoch == 0 : self . best_metric = metric [ 'testing' ] self . _save_best ( model , optimizer , metric , current_epoch , loss ) if not current_epoch % self . step_size : self . _save_current ( model , optimizer , metric , current_epoch , loss )
Save checkpoint if step size conditions meet, and update
best checkpoint based on metric and mode.
Save checkpoint if step size conditions meet and update best checkpoint based on metric and mode .
"""Save checkpoint if step size conditions meet, and update
        best checkpoint based on metric and mode.
        """ # Check if the current model is the best
self
model
optimizer
metric
current_epoch
loss