From f49c2f4c254080640c0a39246048aab9300590df Mon Sep 17 00:00:00 2001 From: William Falcon Date: Tue, 25 Jun 2019 20:22:21 -0400 Subject: [PATCH] updated args --- docs/source/examples/example_model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/examples/example_model.py b/docs/source/examples/example_model.py index fe45ae5091..3238dab773 100644 --- a/docs/source/examples/example_model.py +++ b/docs/source/examples/example_model.py @@ -110,13 +110,13 @@ class ExampleModel(RootModule): :return: """ val_loss_mean = 0 - accs = [] + val_acc_mean = 0 for output in outputs: val_loss_mean += output['val_loss'] - accs.append(output['val_acc']) + val_acc_mean += output['val_acc'] val_loss_mean /= len(outputs) - tqdm_dic = {'val_loss': val_loss_mean, 'val_acc': torch.mean(accs).item()} + tqdm_dic = {'val_loss': val_loss_mean.item(), 'val_acc': val_acc_mean.item()} return tqdm_dic def update_tng_log_metrics(self, logs):