Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max_loss is not being updated #16

Open
junhyk opened this issue Aug 28, 2019 · 1 comment
Open

max_loss is not being updated #16

junhyk opened this issue Aug 28, 2019 · 1 comment

Comments

@junhyk
Copy link

junhyk commented Aug 28, 2019

Hi,

It seems that max_loss in function train_epochs() at esrnn/trainer.py is not being updated appropriately

def train_epochs(self):
        max_loss = 1e8
        start_time = time.time()
        for e in range(self.max_epochs):
            self.scheduler.step()
            epoch_loss = self.train()
            if epoch_loss < max_loss:
                self.save()
            epoch_val_loss = self.val()
            if e == 0:
                file_path = os.path.join(self.csv_save_path, 'validation_losses.csv')
                with open(file_path, 'w') as f:
                    f.write('epoch,training_loss,validation_loss\n')
            with open(file_path, 'a') as f:
                f.write(','.join([str(e), str(epoch_loss), str(epoch_val_loss)]) + '\n')
        print('Total Training Mins: %5.2f' % ((time.time()-start_time)/60))

Thanks!

@junhyk junhyk changed the title max_loss not updating max_loss is not being updated Aug 28, 2019
@zhangdoudou
Copy link

Right, this code is not formal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants