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