1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Streaming Mamba (selective state space model) for temporal ML pipelines.
//!
//! This module provides [`StreamingMamba`], a streaming machine learning model
//! that uses a Mamba-style selective SSM as its temporal feature extractor,
//! feeding into a Recursive Least Squares (RLS) readout layer. It integrates
//! with irithyll's [`StreamingLearner`](crate::learner::StreamingLearner) trait
//! and [`StreamingPreprocessor`](crate::pipeline::StreamingPreprocessor) trait.
//!
//! # Architecture
//!
//! ```text
//! input features ──→ [SelectiveSSM] ──→ temporal features ──→ [RLS] ──→ prediction
//! (d_in) (d_in state) (d_in) (1)
//! ```
//!
//! The SSM processes each feature vector as a timestep, maintaining per-channel
//! hidden state that captures temporal dynamics. The RLS readout learns a linear
//! mapping from the SSM's output to the target variable.
//!
//! # Components
//!
//! - [`StreamingMamba`] -- full model implementing `StreamingLearner`
//! - [`MambaPreprocessor`] -- SSM-only preprocessor implementing `StreamingPreprocessor`
//! - [`MambaConfig`] / [`MambaConfigBuilder`] -- validated configuration
//!
//! # Example
//!
//! ```
//! use irithyll::ssm::{StreamingMamba, MambaConfig};
//! use irithyll::learner::StreamingLearner;
//!
//! let config = MambaConfig::builder()
//! .d_in(4)
//! .n_state(16)
//! .build()
//! .unwrap();
//!
//! let mut model = StreamingMamba::new(config);
//! model.train(&[1.0, 2.0, 3.0, 4.0], 5.0);
//! let pred = model.predict(&[1.0, 2.0, 3.0, 4.0]);
//! assert!(pred.is_finite());
//! ```
pub use StreamingMamba;
pub use ;
pub use MambaPreprocessor;