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
51
52
53
54
55
//! Spiking Neural Networks for streaming machine learning.
//!
//! This module wraps the `irithyll-core` fixed-point SNN with f64 interfaces,
//! automatic input scaling, and implementations of [`StreamingLearner`](crate::learner::StreamingLearner) and
//! [`StreamingPreprocessor`](crate::pipeline::StreamingPreprocessor) for seamless integration with irithyll pipelines.
//!
//! # Components
//!
//! - [`SpikeNet`] -- f64-interfaced SNN implementing [`StreamingLearner`](crate::learner::StreamingLearner)
//! - [`SpikeNetConfig`] / [`SpikeNetConfigBuilder`] -- configuration with validation
//! - [`SpikePreprocessor`] -- SNN as a feature transformer implementing [`StreamingPreprocessor`](crate::pipeline::StreamingPreprocessor)
//!
//! # Example
//!
//! ```
//! use irithyll::snn::{SpikeNet, SpikeNetConfig};
//! use irithyll::StreamingLearner;
//!
//! let config = SpikeNetConfig::builder()
//! .n_hidden(32)
//! .learning_rate(0.005)
//! .build()
//! .unwrap();
//!
//! let mut model = SpikeNet::new(config);
//! model.train(&[0.5, -0.3, 0.8], 1.0);
//! let pred = model.predict(&[0.5, -0.3, 0.8]);
//! ```
//!
//! # As a Pipeline Preprocessor
//!
//! ```
//! use irithyll::snn::SpikePreprocessor;
//! use irithyll::pipeline::{Pipeline, StreamingPreprocessor};
//! use irithyll::learners::StreamingLinearModel;
//! use irithyll::StreamingLearner;
//!
//! let mut pipeline = Pipeline::builder()
//! .pipe(SpikePreprocessor::new(16, 42))
//! .learner(StreamingLinearModel::new(0.01));
//!
//! pipeline.train(&[1.0, 2.0, 3.0], 5.0);
//! let pred = pipeline.predict(&[1.0, 2.0, 3.0]);
//! ```
pub use SpikePreprocessor;
pub use SpikeNet;
pub use ;
/// Convenience alias for [`SpikeNet`].
pub type StreamingSpikeNet = SpikeNet;