Skip to content

Commit

Permalink
feat(evaluation): display fitting progress
Browse files Browse the repository at this point in the history
  • Loading branch information
SherlockMones committed Jul 6, 2022
1 parent 7f66f48 commit c53819f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions aucmedi/evaluation/fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@
#-----------------------------------------------------#
# Evaluation - Plot Fitting #
#-----------------------------------------------------#
def evaluate_fitting(train_history, out_path, monitor=["loss"],
prefix_split=".", suffix=None):
def evaluate_fitting(train_history,
out_path,
monitor=["loss"],
prefix_split=".",
suffix=None,
show=False
):
""" Function for automatic plot generation providing a training history dictionary.
!!! info "Preview"
Expand Down Expand Up @@ -58,6 +63,7 @@ def evaluate_fitting(train_history, out_path, monitor=["loss"],
monitor (list of str): List of metrics which should be visualized in the fitting plot.
prefix_split (str): Split prefix for keys in the history dictionary. Used for Bagging and Stacking.
suffix (str): Special suffix to add in the created figure filename.
show (bool): Option, whether to also display the generated chart.
"""
# Combine transfer learning logs if present
if ("cv_0.tl_loss" in train_history and "cv_0.ft_loss" in train_history) or\
Expand Down Expand Up @@ -137,6 +143,8 @@ def evaluate_fitting(train_history, out_path, monitor=["loss"],
fig.save(filename=filename,
path=out_path, dpi=200, limitsize=False)

if show : print(fig)

#-----------------------------------------------------#
# Subroutines #
#-----------------------------------------------------#
Expand Down

0 comments on commit c53819f

Please sign in to comment.