Skip to contents

Two-column diagnostic plot. The left column shows operational metrics (total loss, gradient norm, learning rate); the right column decomposes the total loss into its components (Poisson deviance, barrier penalty, entropy penalty), each with its own y-axis so every term is clearly visible regardless of scale.

Usage

plot_convergence(
  result,
  which = c("loss", "gradient", "lr"),
  log_y = TRUE,
  ...
)

Arguments

result

An interpElections_result object.

which

Character vector. Which panels to show: any combination of "loss", "gradient", "lr". Default: all three. Selecting "loss" adds both the total loss panel (left column) and the individual component panels (right column).

log_y

Logical. Use log scale for y-axis on loss and gradient panels? Default: TRUE. Learning rate is always on linear scale.

...

Ignored.

Value

A ggplot or patchwork object (invisibly). Prints the plot.

Details

When component histories are unavailable (legacy result objects) or the patchwork package is not installed, the function falls back to a single-column layout.