From 917e86f3d30c3fa487e0df85707408f0d7fcf777 Mon Sep 17 00:00:00 2001
From: dcarron <daniel.carron@idiap.ch>
Date: Wed, 24 Jan 2024 15:14:13 +0100
Subject: [PATCH] [doc] Add documentation about train-analysis

---
 .gitignore             |  1 +
 doc/usage/training.rst | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/.gitignore b/.gitignore
index 6ca994eb..f49b5922 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,3 +26,4 @@ _work/
 .mypy_cache/
 .pytest_cache/
 results*/
+trainlog.pdf
diff --git a/doc/usage/training.rst b/doc/usage/training.rst
index 9ca5e01d..f071febe 100644
--- a/doc/usage/training.rst
+++ b/doc/usage/training.rst
@@ -64,4 +64,23 @@ To train Pasa CNN on the Montgomery dataset:
       mednet train -vv mlp shenzhen_rs --batch-size=4 --epochs=20
 
 
+
+Plotting training metrics
+-------------------------
+
+Various metrics are recorded at each epoch during training, such as the execution time, loss and resource usage.
+These are saved in a Tensorboard file, located in a `logs` subdirectory of the training output folder.
+
+Mednet provides a :ref:`train-analysis <mednet.cli>` convenience script that graphs the scalars stored in these files and saves them in a pdf file.
+
+Examples
+========
+
+Generates a pdf file with plots showing the evolution of logged metrics in time:
+
+.. code:: sh
+
+   mednet train-analysis -vv <results/logs/folder> -o <results/trainlog.pdf>
+
+
 .. include:: ../links.rst
-- 
GitLab