pub struct RoutingPolicy {
pub alpha: f32,
pub beta: f32,
pub gamma: f32,
pub delta: f32,
pub threshold: f32,
pub description: String,
}Expand description
A routing policy equation for scoring neurons.
The policy computes a routing score for each neuron:
score = α·spikes - β·adaptation - γ·error + δ·base_weight
Fields§
§alpha: f32Weight for spike count contribution.
beta: f32Weight for adaptation penalty.
gamma: f32Weight for error penalty.
delta: f32Weight for base synaptic strength.
threshold: f32Minimum score threshold to activate a neuron.
description: StringHuman-readable description of the policy origin.
Implementations§
Source§impl RoutingPolicy
impl RoutingPolicy
Sourcepub fn score(
&self,
neuron: usize,
snapshot: &NeuronStateSnapshot,
base_weight: f32,
) -> f32
pub fn score( &self, neuron: usize, snapshot: &NeuronStateSnapshot, base_weight: f32, ) -> f32
Compute the routing score for a single neuron.
Sourcepub fn should_activate(&self, score: f32) -> bool
pub fn should_activate(&self, score: f32) -> bool
Check if a neuron should be activated based on its score.
Trait Implementations§
Source§impl Clone for RoutingPolicy
impl Clone for RoutingPolicy
Source§fn clone(&self) -> RoutingPolicy
fn clone(&self) -> RoutingPolicy
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 RoutingPolicy
impl Debug for RoutingPolicy
Source§impl Default for RoutingPolicy
impl Default for RoutingPolicy
Source§impl<'de> Deserialize<'de> for RoutingPolicy
impl<'de> Deserialize<'de> for RoutingPolicy
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 RoutingPolicy
impl RefUnwindSafe for RoutingPolicy
impl Send for RoutingPolicy
impl Sync for RoutingPolicy
impl Unpin for RoutingPolicy
impl UnsafeUnpin for RoutingPolicy
impl UnwindSafe for RoutingPolicy
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