Skip to contents

Plots the per-epoch training and (optionally) validation loss from the history slot of a swrc_fit object. A log(1 + x) y-axis is used so that both the (larger) composite training loss and the (small) validation MSE remain clearly visible on the same panel.

Usage

plot_training_history(
  fit,
  loss_col = "loss",
  val_col = "val_mse",
  log_scale = TRUE,
  base_size = 12
)

Arguments

fit

A swrc_fit object.

loss_col

Column in fit$history to display (default "loss").

val_col

Validation loss column (default "val_mse"). Pass NULL to omit.

log_scale

Logical; apply log1p transformation to the y-axis (default TRUE).

base_size

Base font size (default 12).

Value

A ggplot object.