trainers/trainer.py
def train_epoch(self, num_epoch=None):
        """
       implement the logic of epoch:
       -loop on the number of iterations in the config and call the train step

        Train one epoch
        :param epoch: cur epoch number
        :return accuracy and loss on train set
        """
        # initialize dataset
        self.data_loader.initialize(is_train=True)

        # initialize tqdm
        tt = tqdm(range(self.data_loader.num_iterations_train), total=self.data_loader.num_iterations_train,
                  desc="epoch-{}-".format(num_epoch))

        total_loss = 0.
        total_correct = 0.

        # Iterate over batches
        for cur_it in tt:
            # One Train step on the current batch
            loss, correct = self.train_step()
#             print(f'loss device : {loss.device}')
#             print(f'correct device : {correct.device}')
            # update results from train_step func
            total_loss += loss
            total_correct += correct

#         # save model
#         if num_epoch % self.config.save_rate == 0:
#             self.model.save(self.sess)

        loss_per_epoch = total_loss/self.data_loader.train_size
        acc_per_epoch = total_correct/self.data_loader.train_size
        print("""
        Epoch-{}  loss:{:.4f} -- acc:{:.4f}
                """.format(num_epoch, loss_per_epoch, acc_per_epoch))

        tt.close()
        return acc_per_epoch, loss_per_epoch

       implement the logic of epoch:
       -loop on the number of iterations in the config and call the train step

        Train one epoch
        :param epoch: cur epoch number
        :return accuracy and loss on train set
        
implement the logic of epoch:
loop on the number of iterations in the config and call the train step

Train one epoch
:param epoch: cur epoch number
:return accuracy and loss on train set
implement the logic of epoch : loop on the number of iterations in the config and call the train step Train one epoch : param epoch : cur epoch number : return accuracy and loss on train set
def train_epoch(self, num_epoch=None):
        self.data_loader.initialize(is_train=True)
        tt = tqdm(range(self.data_loader.num_iterations_train), total=self.data_loader.num_iterations_train,
                  desc="epoch-{}-".format(num_epoch))
        total_loss = 0.
        total_correct = 0.
        for cur_it in tt:
            loss, correct = self.train_step()
            total_loss += loss
            total_correct += correct
        loss_per_epoch = total_loss/self.data_loader.train_size
        acc_per_epoch = total_correct/self.data_loader.train_size
        print("""
        Epoch-{}  loss:{:.4f} -- acc:{:.4f}
                """.format(num_epoch, loss_per_epoch, acc_per_epoch))
        tt.close()
        return acc_per_epoch, loss_per_epoch
def train_epoch ( self , num_epoch = None ) : self . data_loader . initialize ( is_train = True ) tt = tqdm ( range ( self . data_loader . num_iterations_train ) , total = self . data_loader . num_iterations_train , desc = "epoch-{}-" . format ( num_epoch ) ) total_loss = 0. total_correct = 0. for cur_it in tt : loss , correct = self . train_step ( ) total_loss += loss total_correct += correct loss_per_epoch = total_loss / self . data_loader . train_size acc_per_epoch = total_correct / self . data_loader . train_size print ( """
        Epoch-{}  loss:{:.4f} -- acc:{:.4f}
                """ . format ( num_epoch , loss_per_epoch , acc_per_epoch ) ) tt . close ( ) return acc_per_epoch , loss_per_epoch
implement the logic of epoch:
loop on the number of iterations in the config and call the train step
implement the logic of epoch : loop on the number of iterations in the config and call the train step
"""
       implement the logic of epoch:
       -loop on the number of iterations in the config and call the train step

        Train one epoch
        :param epoch: cur epoch number
        :return accuracy and loss on train set
        """ # initialize dataset # initialize tqdm # Iterate over batches # One Train step on the current batch #             print(f'loss device : {loss.device}') #             print(f'correct device : {correct.device}') # update results from train_step func #         # save model #         if num_epoch % self.config.save_rate == 0: #             self.model.save(self.sess)
self
num_epoch