pub struct Projection {
pub source_pop: usize,
pub target_pop: usize,
/* private fields */
}Expand description
A projection from a source population to a target population.
Fields§
§source_pop: usizeSource population index
target_pop: usizeTarget population index
Implementations§
Source§impl Projection
impl Projection
Sourcepub fn new<R: Rng>(
source_pop: usize,
target_pop: usize,
source_size: usize,
target_size: usize,
pattern: &ConnectionPattern,
synapse_template: &Synapse,
weight_init: WeightInit,
delay_init: DelayInit,
rng: &mut R,
) -> Result<Self>
pub fn new<R: Rng>( source_pop: usize, target_pop: usize, source_size: usize, target_size: usize, pattern: &ConnectionPattern, synapse_template: &Synapse, weight_init: WeightInit, delay_init: DelayInit, rng: &mut R, ) -> Result<Self>
Create a new projection with specified connection pattern.
§Arguments
source_pop- Source population indextarget_pop- Target population indexsource_size- Number of neurons in source populationtarget_size- Number of neurons in target populationpattern- Connection patternsynapse_template- Template synapse (will be cloned for each connection)weight_init- Weight initialization schemedelay_init- Delay initialization schemerng- Random number generator
Sourcepub fn all_to_all<R: Rng>(
source_pop: usize,
target_pop: usize,
source_size: usize,
target_size: usize,
synapse_template: &Synapse,
weight: f64,
delay: f64,
rng: &mut R,
) -> Result<Self>
pub fn all_to_all<R: Rng>( source_pop: usize, target_pop: usize, source_size: usize, target_size: usize, synapse_template: &Synapse, weight: f64, delay: f64, rng: &mut R, ) -> Result<Self>
Create an all-to-all projection.
Sourcepub fn one_to_one<R: Rng>(
source_pop: usize,
target_pop: usize,
size: usize,
synapse_template: &Synapse,
weight: f64,
delay: f64,
rng: &mut R,
) -> Result<Self>
pub fn one_to_one<R: Rng>( source_pop: usize, target_pop: usize, size: usize, synapse_template: &Synapse, weight: f64, delay: f64, rng: &mut R, ) -> Result<Self>
Create a one-to-one projection.
Sourcepub fn fixed_probability<R: Rng>(
source_pop: usize,
target_pop: usize,
source_size: usize,
target_size: usize,
probability: f64,
synapse_template: &Synapse,
weight: f64,
delay: f64,
rng: &mut R,
) -> Result<Self>
pub fn fixed_probability<R: Rng>( source_pop: usize, target_pop: usize, source_size: usize, target_size: usize, probability: f64, synapse_template: &Synapse, weight: f64, delay: f64, rng: &mut R, ) -> Result<Self>
Create a random fixed-probability projection.
Sourcepub fn register_spike(&mut self, source_idx: usize, current_time: f64)
pub fn register_spike(&mut self, source_idx: usize, current_time: f64)
Register a spike from source population.
Sourcepub fn process_spikes(
&mut self,
current_time: f64,
target_voltages: &[f64],
dt: f64,
) -> Result<Vec<(usize, f64)>>
pub fn process_spikes( &mut self, current_time: f64, target_voltages: &[f64], dt: f64, ) -> Result<Vec<(usize, f64)>>
Process delayed spikes and update synapses.
Returns list of (target_idx, synaptic_current) pairs.
Sourcepub fn num_connections(&self) -> usize
pub fn num_connections(&self) -> usize
Get number of connections.
Sourcepub fn connections(&self) -> &[Connection]
pub fn connections(&self) -> &[Connection]
Get all connections.
Sourcepub fn apply_stdp(
&mut self,
source_spike_times: &[Vec<f64>],
target_spike_times: &[Vec<f64>],
) -> Result<()>
pub fn apply_stdp( &mut self, source_spike_times: &[Vec<f64>], target_spike_times: &[Vec<f64>], ) -> Result<()>
Apply STDP learning rule to all synapses.
Sourcepub fn scale_weights(&mut self, factor: f64)
pub fn scale_weights(&mut self, factor: f64)
Scale all weights by a factor.
Sourcepub fn weight_statistics(&self) -> WeightStats
pub fn weight_statistics(&self) -> WeightStats
Get weight statistics.
Trait Implementations§
Source§impl Clone for Projection
impl Clone for Projection
Source§fn clone(&self) -> Projection
fn clone(&self) -> Projection
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 moreAuto Trait Implementations§
impl Freeze for Projection
impl RefUnwindSafe for Projection
impl Send for Projection
impl Sync for Projection
impl Unpin for Projection
impl UnsafeUnpin for Projection
impl UnwindSafe for Projection
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 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.