From 4d3d318a4168ef79847737cef2c0ad8a4dafd3e7 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Thu, 29 Dec 2022 09:00:19 +0100 Subject: Training improvements --- training/lr.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'training/lr.py') diff --git a/training/lr.py b/training/lr.py index c0e9b3f..0c5ce9e 100644 --- a/training/lr.py +++ b/training/lr.py @@ -90,6 +90,7 @@ class LRFinder(): else: if smooth_f > 0: loss = smooth_f * loss + (1 - smooth_f) * losses[-1] + acc = smooth_f * acc + (1 - smooth_f) * accs[-1] if loss < best_loss: best_loss = loss if acc > best_acc: @@ -132,9 +133,9 @@ class LRFinder(): ax_loss.set_xlabel("Learning rate") ax_loss.set_ylabel("Loss") - # ax_acc = ax_loss.twinx() - # ax_acc.plot(lrs, accs, color='blue') - # ax_acc.set_ylabel("Accuracy") + ax_acc = ax_loss.twinx() + ax_acc.plot(lrs, accs, color='blue') + ax_acc.set_ylabel("Accuracy") print("LR suggestion: steepest gradient") min_grad_idx = None -- cgit v1.2.3-54-g00ecf