Skip to main content

Module adaptive

Module adaptive 

Source
Available on crate feature alloc only.
Expand description

Adaptive learning rate wrapper for SGBT ensembles.

AdaptiveSGBT pairs an SGBT model with an LRScheduler, adjusting the learning rate before each training step based on the scheduler’s policy. This enables time-varying learning rates – decay, cosine annealing, plateau reduction – without modifying the core ensemble code.

§Example

use irithyll::ensemble::adaptive::AdaptiveSGBT;
use irithyll::ensemble::lr_schedule::ExponentialDecayLR;
use irithyll::SGBTConfig;
use irithyll::learner::StreamingLearner;

let config = SGBTConfig::builder()
    .n_steps(10)
    .learning_rate(0.1)
    .build()
    .unwrap();

let mut model = AdaptiveSGBT::new(config, ExponentialDecayLR::new(0.1, 0.999));
model.train(&[1.0, 2.0], 3.0);
model.train(&[4.0, 5.0], 6.0);

// The learning rate adapts over time.
let pred = model.predict(&[1.0, 2.0]);

Structs§

AdaptiveSGBT
SGBT ensemble with an attached learning rate scheduler.