optirs_learned/adaptive/
adaptiveconfig_traits.rs1use scirs2_core::numeric::Float;
12use std::fmt::Debug;
13
14use super::types::AdaptiveConfig;
15
16impl<T: Float + Debug + Send + Sync + 'static> Default for AdaptiveConfig<T> {
17 fn default() -> Self {
18 Self {
19 adaptive_sequence_length: true,
20 max_sequence_length: 1024,
21 min_sequence_length: 64,
22 attention_sparsity_threshold: scirs2_core::numeric::NumCast::from(0.1)
23 .unwrap_or_else(|| T::zero()),
24 memory_budget: 8192,
25 dynamic_head_pruning: true,
26 layer_adaptation: true,
27 landscape_analysis_frequency: 100,
28 prediction_horizon: 50,
29 adaptation_lr: scirs2_core::numeric::NumCast::from(0.001).unwrap_or_else(|| T::zero()),
30 }
31 }
32}