From 0c75fce4eb0be54a3c7f0a326b38bfa233eeb36a Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Mon, 25 Apr 2022 20:29:28 +0200 Subject: [PATCH] Update. --- mygpt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mygpt.py b/mygpt.py index e6387bd..13fbe8e 100755 --- a/mygpt.py +++ b/mygpt.py @@ -508,7 +508,10 @@ for k in range(args.nb_epochs): acc_test_loss += loss.item() * input.size(0) nb_test_samples += input.size(0) - log_string(f'perplexity {k+1} train {math.exp(min(100, acc_train_loss/nb_train_samples))} test {math.exp(min(100, acc_test_loss/nb_test_samples))}') + train_perplexity = math.exp(min(100, acc_train_loss/nb_train_samples)) + test_perplexity = math.exp(min(100, acc_test_loss/nb_test_samples)) + + log_string(f'perplexity {k+1} train {train_perplexity} test {test_perplexity}') task.produce_results(k, model) -- 2.39.5