pub struct HomeostaticSynapse { /* private fields */ }Expand description
Homeostatic synapse with activity-dependent scaling
This synapse implements homeostatic scaling to maintain stable activity levels by globally scaling synaptic weights based on the target activity level.
Implementations§
Source§impl HomeostaticSynapse
impl HomeostaticSynapse
Sourcepub fn new(
pre_neuron: usize,
post_neuron: usize,
initial_weight: f64,
target_activity: f64,
) -> Self
pub fn new( pre_neuron: usize, post_neuron: usize, initial_weight: f64, target_activity: f64, ) -> Self
Create new homeostatic synapse
§Arguments
pre_neuron- ID of pre-synaptic neuronpost_neuron- ID of post-synaptic neuroninitial_weight- Initial synaptic weighttarget_activity- Target activity level for homeostasis
Sourcepub fn update(
&mut self,
current_time: f64,
pre_spiked: bool,
post_spiked: bool,
dt: f64,
)
pub fn update( &mut self, current_time: f64, pre_spiked: bool, post_spiked: bool, dt: f64, )
Update synapse with homeostatic scaling
§Arguments
current_time- Current simulation timepre_spiked- Whether pre-synaptic neuron spikedpost_spiked- Whether post-synaptic neuron spikeddt- Time step size
Sourcepub fn base_synapse(&self) -> &Synapse
pub fn base_synapse(&self) -> &Synapse
Get reference to base synapse
Sourcepub fn current_activity(&self) -> f64
pub fn current_activity(&self) -> f64
Get current activity estimate
Sourcepub fn target_activity(&self) -> f64
pub fn target_activity(&self) -> f64
Get target activity
Sourcepub fn set_target_activity(&mut self, target: f64)
pub fn set_target_activity(&mut self, target: f64)
Set target activity
Sourcepub fn activity_error(&self) -> f64
pub fn activity_error(&self) -> f64
Get activity error (current - target)
Trait Implementations§
Source§impl Clone for HomeostaticSynapse
impl Clone for HomeostaticSynapse
Source§fn clone(&self) -> HomeostaticSynapse
fn clone(&self) -> HomeostaticSynapse
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 HomeostaticSynapse
impl RefUnwindSafe for HomeostaticSynapse
impl Send for HomeostaticSynapse
impl Sync for HomeostaticSynapse
impl Unpin for HomeostaticSynapse
impl UnwindSafe for HomeostaticSynapse
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.