-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started

Generated with Grok Build: Grok 4.5 · xAI Imagine (/imagine)
Requires Rust 1.97.1+ (MSRV; pinned in rust-toolchain.toml).
[dependencies]
neuromod = "0.5.2"There is no optional sentry Cargo feature as of 0.5.2. For error monitoring, depend on the sentry crate in your application binary — see Sentry.
cargo test
cargo test --all-features
cargo run --example basic
cargo run --example rstdp_demo
cargo run --example basic_lif
cargo run --example hebbian_learningSpikingNetwork integrates LIF + Izhikevich only (default: 16 LIF, 5 Izh, 16 channels).
use neuromod::{NeuroModulators, SpikingNetwork};
let mut network = SpikingNetwork::new(); // 16 LIF, 5 Izhikevich, 16 channels
let stimuli = [0.5_f32; 16];
let modulators = NeuroModulators::default();
let spikes = network.step(&stimuli, &modulators).unwrap(); // indices that fireduse neuromod::{NeuroModulators, SpikingNetwork};
let mut network = SpikingNetwork::with_dimensions(518, 5, 518);
let stimuli = vec![0.25_f32; 518];
let spikes = network.step(&stimuli, &NeuroModulators::default()).unwrap();step requires stimuli.len() == num_channels or returns StepError::InputLenMismatch { expected, got }.
use neuromod::{
apply_neuromodulation, GenericReward, NeuroModulators, Observation, SignalProfile, UnitReward,
};
let profile = SignalProfile::default();
let mut mods = NeuroModulators::from_signals(&profile, 0.2, 0.1, 0.8, 0.9);
mods.add_reward(0.2);
mods.add_norepinephrine(0.1); // renamed from add_stress in 0.5.0
mods.boost_focus(0.3);
mods.add_serotonin(0.4);
mods.decay();
let reward = UnitReward;
let obs = Observation::from_slice(&[0.5, 0.7]);
mods.apply_reward(&reward, &obs);
let mut weights = vec![1.0, 0.8];
let mut thresholds = vec![0.20, 0.25];
apply_neuromodulation(&mods, &mut weights, &mut thresholds);For legacy hardware-calibrated signal mapping: SignalProfile::hardware_calibrated().
See Release Notes — field removals (cortisol / tempo / aux_dopamine), from_signals + SignalProfile, add_stress → add_norepinephrine.
Last updated: August 12, 2026
Updated by: Grok Build: Grok 4.5 (high)
Package tip reference: 328ea9c (main @ 0.5.2 + #97/#98; tag v0.5.2 = ef9fba8)
Cubic: page-intro
Devin DeepWiki: neuromod @ 328ea9c