Visualize training loss over steps for TorchDecon models.
Usage
PlotTrainingHistory(model, log_scale = FALSE, smooth = TRUE, smooth_span = 0.1)
Arguments
- model
A trained TorchDeconModel or TorchDeconEnsemble object,
or a data frame from GetTrainingHistory().
- log_scale
Logical. Use log scale for y-axis. Default is FALSE.
- smooth
Logical. Add smoothed line. Default is TRUE.
- smooth_span
Numeric. Span for LOESS smoothing. Default is 0.1.
Value
A ggplot2 object (if ggplot2 is available), otherwise NULL.
Details
This function requires ggplot2 for plotting. If ggplot2 is not available,
it will return the training history data frame.
Examples
if (FALSE) { # \dontrun{
# Plot training history
PlotTrainingHistory(trained_model)
# With log scale
PlotTrainingHistory(trained_model, log_scale = TRUE)
} # }