pub struct StreamingKAN { /* private fields */ }Expand description
Streaming KAN model with online B-spline learning.
Processes one sample at a time. Each edge in the network learns a univariate B-spline activation function via per-sample SGD. Online Welford normalization ensures stable input distribution.
§Example
use irithyll::kan::{StreamingKAN, KANConfig};
use irithyll::StreamingLearner;
let config = KANConfig::builder()
.layer_sizes(vec![3, 10, 1])
.lr(0.01)
.build()
.unwrap();
let mut model = StreamingKAN::new(config);
model.train(&[1.0, 2.0, 3.0], 4.0);
let pred = model.predict(&[1.0, 2.0, 3.0]);Implementations§
Source§impl StreamingKAN
impl StreamingKAN
Sourcepub fn layer_sizes(&self) -> &[usize]
pub fn layer_sizes(&self) -> &[usize]
The layer sizes from the config.
Trait Implementations§
Source§impl Debug for StreamingKAN
impl Debug for StreamingKAN
Source§impl DiagnosticSource for StreamingKAN
impl DiagnosticSource for StreamingKAN
Source§fn config_diagnostics(&self) -> Option<ConfigDiagnostics>
fn config_diagnostics(&self) -> Option<ConfigDiagnostics>
Return config diagnostics, or
None if not supported.Source§impl StreamingLearner for StreamingKAN
impl StreamingLearner for StreamingKAN
Source§fn train_one(&mut self, features: &[f64], target: f64, weight: f64)
fn train_one(&mut self, features: &[f64], target: f64, weight: f64)
Train on a single observation with explicit sample weight. Read more
Source§fn predict(&self, features: &[f64]) -> f64
fn predict(&self, features: &[f64]) -> f64
Predict the target for the given feature vector. Read more
Source§fn n_samples_seen(&self) -> u64
fn n_samples_seen(&self) -> u64
Total number of observations trained on since creation or last reset.
Auto Trait Implementations§
impl Freeze for StreamingKAN
impl RefUnwindSafe for StreamingKAN
impl Send for StreamingKAN
impl Sync for StreamingKAN
impl Unpin for StreamingKAN
impl UnsafeUnpin for StreamingKAN
impl UnwindSafe for StreamingKAN
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more