Skip to main content

entrenar/merge/ensemble/
strategy.rs

1//! ENT-032: Ensemble merging strategy enum
2
3/// Strategy for ensemble merging
4#[derive(Clone, Debug)]
5pub enum EnsembleStrategy {
6    /// Simple weighted average (equivalent to DARE with drop_prob=0)
7    WeightedAverage { weights: Vec<f32> },
8
9    /// TIES merge with configurable density
10    Ties { density: f32 },
11
12    /// DARE merge with dropout
13    Dare { drop_prob: f32, seed: Option<u64> },
14
15    /// Iterative SLERP: merge models pairwise until one remains
16    IterativeSlerp { t: f32 },
17
18    /// Hierarchical: merge in tree structure for balanced combination
19    Hierarchical { leaf_strategy: Box<EnsembleStrategy> },
20}
21
22impl Default for EnsembleStrategy {
23    fn default() -> Self {
24        Self::WeightedAverage {
25            weights: Vec::new(), // Will use uniform weights
26        }
27    }
28}