pub struct STDP {
pub a_plus: f64,
pub a_minus: f64,
pub tau_plus: f64,
pub tau_minus: f64,
pub w_min: f64,
pub w_max: f64,
pub multiplicative: bool,
pub accumulated_dw: f64,
/* private fields */
}Expand description
Spike-Timing Dependent Plasticity (STDP) implementation.
STDP is a biological learning rule where synaptic strength changes depend on the relative timing of pre- and postsynaptic spikes.
Δw = A+ * exp(-Δt/τ+) for Δt > 0 (pre before post, potentiation) Δw = -A- * exp(Δt/τ-) for Δt < 0 (post before pre, depression)
Fields§
§a_plus: f64Amplitude of potentiation.
a_minus: f64Amplitude of depression.
tau_plus: f64Time constant for potentiation (ms).
tau_minus: f64Time constant for depression (ms).
w_min: f64Minimum synaptic weight.
w_max: f64Maximum synaptic weight.
multiplicative: boolWhether to use multiplicative updates (vs additive).
accumulated_dw: f64Accumulated weight change.
Implementations§
Source§impl STDP
impl STDP
Sourcepub fn with_params(
a_plus: f64,
a_minus: f64,
tau_plus: f64,
tau_minus: f64,
) -> Result<Self>
pub fn with_params( a_plus: f64, a_minus: f64, tau_plus: f64, tau_minus: f64, ) -> Result<Self>
Create STDP with custom parameters.
Sourcepub fn multiplicative(self) -> Self
pub fn multiplicative(self) -> Self
Create STDP with multiplicative updates (weight-dependent).
Sourcepub fn post_spike(&mut self, time: f64, current_weight: f64) -> f64
pub fn post_spike(&mut self, time: f64, current_weight: f64) -> f64
Sourcepub fn apply_update(&mut self, weight: f64) -> f64
pub fn apply_update(&mut self, weight: f64) -> f64
Trait Implementations§
Auto Trait Implementations§
impl Freeze for STDP
impl RefUnwindSafe for STDP
impl Send for STDP
impl Sync for STDP
impl Unpin for STDP
impl UnwindSafe for STDP
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