| plot_training_history | R Documentation |
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.
plot_training_history(
fit,
loss_col = "loss",
val_col = "val_mse",
log_scale = TRUE,
base_size = 12
)
fit |
A |
loss_col |
Column in |
val_col |
Validation loss column (default |
log_scale |
Logical; apply |
base_size |
Base font size (default |
A ggplot object.
# plot_training_history() reads only `fit$history`, so a minimal
# swrc_fit carrying one is enough to draw the curve without TensorFlow.
h <- data.frame(
epoch = 1:20,
loss = 1 / (1:20),
val_mse = 1 / (1:20) + 0.01
)
fake <- structure(list(history = h), class = "swrc_fit")
plot_training_history(fake)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.