pub struct NeuronStateSnapshot {
pub adaptation: Vec<f32>,
pub spike_counts: Vec<u32>,
pub error: Vec<f32>,
pub step: u64,
}Expand description
Per-neuron state snapshot for adaptation-aware routing.
Captures the state needed for dynamic routing: per-neuron adaptation levels, spike counts, and error estimates.
Fields§
§adaptation: Vec<f32>Per-neuron adaptation state (0.0 = fresh, 1.0 = fully adapted/exhausted).
spike_counts: Vec<u32>Per-neuron spike count from the last routing window.
error: Vec<f32>Estimated error per neuron (e.g. quantization error from external calibration).
step: u64Global routing step index.
Implementations§
Source§impl NeuronStateSnapshot
impl NeuronStateSnapshot
pub fn new(num_neurons: usize) -> Self
Sourcepub fn adaptation_penalty(&self, neuron: usize, alpha: f32) -> f32
pub fn adaptation_penalty(&self, neuron: usize, alpha: f32) -> f32
Get a routing penalty for a neuron based on its adaptation state. Higher adaptation → higher penalty → less likely to be selected.
Sourcepub fn error_bonus(&self, neuron: usize, beta: f32) -> f32
pub fn error_bonus(&self, neuron: usize, beta: f32) -> f32
Get a routing bonus for a neuron based on low error. Lower error → higher bonus → preferred for routing.
Trait Implementations§
Source§impl Clone for NeuronStateSnapshot
impl Clone for NeuronStateSnapshot
Source§fn clone(&self) -> NeuronStateSnapshot
fn clone(&self) -> NeuronStateSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NeuronStateSnapshot
impl Debug for NeuronStateSnapshot
Source§impl<'de> Deserialize<'de> for NeuronStateSnapshot
impl<'de> Deserialize<'de> for NeuronStateSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NeuronStateSnapshot
impl RefUnwindSafe for NeuronStateSnapshot
impl Send for NeuronStateSnapshot
impl Sync for NeuronStateSnapshot
impl Unpin for NeuronStateSnapshot
impl UnsafeUnpin for NeuronStateSnapshot
impl UnwindSafe for NeuronStateSnapshot
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