pub struct Synapse {
pub pre: usize,
pub post: usize,
pub weight: f64,
pub delay: f64,
pub eligibility: f64,
pub last_update: SimTime,
}Expand description
A single synapse between two neurons
Fields§
§pre: usizePre-synaptic neuron ID
post: usizePost-synaptic neuron ID
weight: f64Synaptic weight
delay: f64Transmission delay (ms)
eligibility: f64Eligibility trace for reward-modulated STDP
last_update: SimTimeLast update time
Implementations§
Source§impl Synapse
impl Synapse
Sourcepub fn with_delay(pre: usize, post: usize, weight: f64, delay: f64) -> Self
pub fn with_delay(pre: usize, post: usize, weight: f64, delay: f64) -> Self
Create synapse with delay
Sourcepub fn stdp_update(
&mut self,
t_pre: SimTime,
t_post: SimTime,
config: &STDPConfig,
) -> f64
pub fn stdp_update( &mut self, t_pre: SimTime, t_post: SimTime, config: &STDPConfig, ) -> f64
Compute STDP weight change
Sourcepub fn decay_eligibility(&mut self, dt: f64, tau: f64)
pub fn decay_eligibility(&mut self, dt: f64, tau: f64)
Decay eligibility trace
Sourcepub fn reward_modulated_update(&mut self, reward: f64, config: &STDPConfig)
pub fn reward_modulated_update(&mut self, reward: f64, config: &STDPConfig)
Apply reward-modulated update (R-STDP)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Synapse
impl RefUnwindSafe for Synapse
impl Send for Synapse
impl Sync for Synapse
impl Unpin for Synapse
impl UnwindSafe for Synapse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more