PyTorch-style ReduceLROnPlateau scheduler. Monitors a metric each epoch and reduces the learning rate when progress plateaus. Supports both "min" (e.g., loss) and "max" (e.g., accuracy) modes, with relative or absolute thresholds for determining improvement. The LR is reduced when the number of non-improving epochs exceeds patience, after which a cooldown period prevents further reductions. Each reduction follows: newLR = max(oldLR * factor, minLR), skipped when the change is too small (≤ eps). Non-finite metric values are ignored. Call step(metric) after each optimizer update. getLastLR returns the most recent learning rate.
Value parameters
cooldown
epochs to wait after a reduction during which bad-epoch counter stays at 0
eps
minimal effective LR change required to apply a reduction
Update the scheduler using the monitored metric (e.g., validation loss). Must be called after each optimizer update. Steps: 1. Ignore non-finite metric values. 2. Test for significant improvement versus best. 3. Update counters (bad-epochs or reset during cooldown). 4. Trigger LR reduction when plateau persists (numBadEpochs > patience).
Update the scheduler using the monitored metric (e.g., validation loss). Must be called after each optimizer update. Steps: 1. Ignore non-finite metric values. 2. Test for significant improvement versus best. 3. Update counters (bad-epochs or reset during cooldown). 4. Trigger LR reduction when plateau persists (numBadEpochs > patience).