pub trait SSMLayer: Send + Sync {
// Required methods
fn forward(&mut self, input: &[f64]) -> Vec<f64>;
fn state(&self) -> &[f64];
fn output_dim(&self) -> usize;
fn reset(&mut self);
}Available on crate feature
alloc only.Expand description
Trait for SSM layers that process sequential data one timestep at a time.
Implementors maintain internal hidden state that evolves with each call to
forward. The hidden state captures temporal patterns
from the input sequence without requiring storage of past observations.
§Thread Safety
All SSM layers are Send + Sync, enabling use in async pipelines and
parallel prediction contexts.
Required Methods§
Sourcefn forward(&mut self, input: &[f64]) -> Vec<f64>
fn forward(&mut self, input: &[f64]) -> Vec<f64>
Process one input timestep and return the output vector.
This advances the internal hidden state by one step. The output dimension equals the input dimension for selective SSMs, or 1 for scalar diagonal SSMs.
§Arguments
input– feature vector for this timestep
Sourcefn output_dim(&self) -> usize
fn output_dim(&self) -> usize
Output dimension of this SSM layer.