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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! # neuromod — Spiking neural network primitives
//!
//! Biologically grounded SNN building blocks for Rust: a topology-neutral
//! [`SpikingNetwork`] engine (LIF + Izhikevich banks), generic neuromodulators,
//! classical STDP helpers, and reward-modulated STDP types.
//!
//! Aimed at **SNN / neuroscience readers learning Rust**: equations and
//! engine contracts first; idiomatic APIs second.
//!
//! ## Requirements
//!
//! - **Rust 1.97.1+** (MSRV; also `rust-version` in `Cargo.toml` and
//! [`rust-toolchain.toml`](https://github.com/Limen-Neural/neuromod/blob/main/rust-toolchain.toml)).
//! - Edition **2024**.
//! - **CI-tested platforms:** Linux, macOS, and Windows (GitHub Actions matrix).
//!
//! ## Syllabus (reading order on docs.rs)
//!
//! 1. This page — engine vs standalone honesty and a quick start.
//! 2. [`engine`] — [`SpikingNetwork`] and the per-tick [`SpikingNetwork::step`] contract.
//! 3. [`lif`] / [`izhikevich`] — the two banks the engine actually wires.
//! 4. [`modulators`] — dopamine / serotonin / acetylcholine / norepinephrine.
//! 5. [`rm_stdp`] / [`hebbian`] — plasticity building blocks (eligibility traces are
//! **not** yet consumed by the live engine path; see those modules).
//! 6. Standalone models ([`lapicque`], [`gif`], [`fitzhugh_nagumo`], [`hodgkin_huxley`])
//! for research use outside the engine.
//!
//! ## Engine vs standalone models
//!
//! - **`SpikingNetwork`** wires **LIF** and **Izhikevich** neuron banks only
//! (`with_dimensions(num_lif, num_izh, num_channels)`).
//! - **Standalone** types (`LapicqueNeuron`, `GifNeuron`, `FitzHughNagumoNeuron`,
//! `HodgkinHuxleyNeuron`, …) are usable on their own; they are not alternate
//! engine banks.
//! - Plasticity: classical Hebbian STDP utilities plus `EligibilityTrace` /
//! `RmStdpConfig` building blocks. Live `step` learning is dopamine-gated and
//! updates LIF weights **directly** (not via eligibility conversion).
//!
//! ## Features
//!
//! - Topology-neutral, dynamically sized `SpikingNetwork`
//! - Neuromodulators: dopamine, serotonin, acetylcholine, norepinephrine
//!
//! ```rust
//! use neuromod::{NeuroModulators, SpikingNetwork};
//!
//! let mut network = SpikingNetwork::new();
//! let stimuli = [0.5f32; 16];
//! let modulators = NeuroModulators::default();
//! let output = network.step(&stimuli, &modulators).unwrap();
//! println!("Neurons that fired: {output:?}");
//!
//! // Or build dynamically for larger architectures.
//! let mut large = SpikingNetwork::with_dimensions(518, 5, 518);
//! let large_input = vec![0.25f32; 518];
//! let _ = large.step(&large_input, &modulators).unwrap();
//! ```
pub use ;
pub use FitzHughNagumoNeuron;
pub use GifNeuron;
pub use ;
pub use HodgkinHuxleyNeuron;
pub use IzhikevichNeuron;
pub use LapicqueNeuron;
pub use LifNeuron;
pub use ;
pub use ;
/// Number of input channels supported by default.
pub const NUM_INPUT_CHANNELS: usize = 16;