Commit 4d2e9395 authored by Andrei-Claudiu Roibu's avatar Andrei-Claudiu Roibu 🖥
Browse files

eliminated redundant variable for early stop

parent 3e3c9426
......@@ -217,8 +217,7 @@ class Solver():
self.LogWriter.loss_per_epoch(losses, phase, epoch)
if phase == 'validation':
validation_loss = np.mean(losses)
early_stop, save_checkpoint = self.EarlyStopping(validation_loss)
early_stop, save_checkpoint = self.EarlyStopping(np.mean(losses))
self.early_stop = early_stop
if save_checkpoint == True:
self.save_checkpoint(state={'epoch': epoch + 1,
......@@ -232,9 +231,6 @@ class Solver():
'checkpoint_epoch_' + str(epoch) + '.' + checkpoint_extension)
)
del validation_loss, early_stop, save_checkpoint
torch.cuda.empty_cache()
print("Epoch {}/{} DONE!".format(epoch, self.number_epochs))
# Early Stop Condition
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment