pub struct MetaplasticSynapse { /* private fields */ }Expand description
Metaplastic synapse with history-dependent learning
This synapse extends basic STDP with metaplasticity - the learning rate itself adapts based on the history of synaptic activity. This provides more sophisticated learning dynamics.
Implementations§
Source§impl MetaplasticSynapse
impl MetaplasticSynapse
Sourcepub fn new(
pre_neuron: usize,
post_neuron: usize,
initial_weight: f64,
base_learning_rate: f64,
) -> Self
pub fn new( pre_neuron: usize, post_neuron: usize, initial_weight: f64, base_learning_rate: f64, ) -> Self
Create new metaplastic synapse
§Arguments
pre_neuron- ID of pre-synaptic neuronpost_neuron- ID of post-synaptic neuroninitial_weight- Initial synaptic weightbase_learning_rate- Base STDP learning rate
Sourcepub fn update(&mut self, current_time: f64, pre_spiked: bool, post_spiked: bool)
pub fn update(&mut self, current_time: f64, pre_spiked: bool, post_spiked: bool)
Update synapse with metaplasticity
§Arguments
current_time- Current simulation timepre_spiked- Whether pre-synaptic neuron spikedpost_spiked- Whether post-synaptic neuron spiked
Sourcepub fn base_synapse(&self) -> &Synapse
pub fn base_synapse(&self) -> &Synapse
Get reference to base synapse
Sourcepub fn base_synapse_mut(&mut self) -> &mut Synapse
pub fn base_synapse_mut(&mut self) -> &mut Synapse
Get mutable reference to base synapse
Sourcepub fn current_learning_rate(&self) -> f64
pub fn current_learning_rate(&self) -> f64
Get current learning rate
Sourcepub fn average_recent_activity(&self) -> f64
pub fn average_recent_activity(&self) -> f64
Get average recent activity
Sourcepub fn reset_history(&mut self)
pub fn reset_history(&mut self)
Reset metaplasticity history
Trait Implementations§
Source§impl Clone for MetaplasticSynapse
impl Clone for MetaplasticSynapse
Source§fn clone(&self) -> MetaplasticSynapse
fn clone(&self) -> MetaplasticSynapse
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MetaplasticSynapse
impl RefUnwindSafe for MetaplasticSynapse
impl Send for MetaplasticSynapse
impl Sync for MetaplasticSynapse
impl Unpin for MetaplasticSynapse
impl UnwindSafe for MetaplasticSynapse
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.