callback_early_stopping: Early stopping callback for survdnn

View source: R/callbacks.R

callback_early_stoppingR Documentation

Early stopping callback for survdnn

Description

Simple early stopping on a monitored scalar, typically the training loss.

Usage

callback_early_stopping(
  patience = 10L,
  min_delta = 0,
  mode = c("min", "max"),
  verbose = FALSE
)

Arguments

patience

Integer. Number of epochs with no improvement before stopping.

min_delta

Minimum change to qualify as an improvement (default: 0).

mode

Character. "min" (for losses) or "max" (for metrics to maximize).

verbose

Logical. Whether to print a message when early stopping is triggered.

Value

A function of the form 'function(epoch, current)' that returns TRUE if training should stop, FALSE otherwise.


survdnn documentation built on Jan. 8, 2026, 9:07 a.m.