From e1b504bca41a9793ed7e88ef14f2e2cbd85724f2 Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Tue, 8 Sep 2020 23:14:23 +0200 Subject: IAM datasets implemented. --- src/training/trainer/util.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/training/trainer/util.py') diff --git a/src/training/trainer/util.py b/src/training/trainer/util.py index 132b2dc..7cf1b45 100644 --- a/src/training/trainer/util.py +++ b/src/training/trainer/util.py @@ -1,4 +1,13 @@ """Utility functions for training neural networks.""" +from typing import Dict, Optional + +from loguru import logger + + +def log_val_metric(metrics_mean: Dict, epoch: Optional[int] = None) -> None: + """Logging of val metrics to file/terminal.""" + log_str = "Validation metrics " + (f"at epoch {epoch} - " if epoch else " - ") + logger.debug(log_str + " - ".join(f"{k}: {v:.4f}" for k, v in metrics_mean.items())) class RunningAverage: -- cgit v1.2.3-70-g09d2