Skip to main content

lr_range_test

Function lr_range_test 

Source
pub fn lr_range_test<F>(
    config: &LrFinderConfig,
    compute_loss: F,
) -> LrFinderResult
where F: FnMut(f32) -> f32,
Expand description

Run an LR range test.

This generates a schedule of learning rates and calls compute_loss for each one. The user-supplied closure should set the optimiser LR and run one training step, returning the resulting loss.

The function applies exponential-moving-average smoothing, then finds the LR at which the smoothed loss decreased most steeply.