pub struct BrunelNetwork {
neurons: Vec<FixedPointLif>,
prev_spikes: Vec<bool>,
w_row_offsets: Vec<usize>,
w_col_indices: Vec<usize>,
w_values: Vec<i16>,
n_neurons: usize,
leak_k: i16,
gain_k: i16,
ext_lambda: f64,
ext_weight_fp: i16,
rng: Xoshiro256PlusPlus,
}Expand description
Brunel balanced network with CSR connectivity and Poisson drive.
Fields§
§neurons: Vec<FixedPointLif>§prev_spikes: Vec<bool>§w_row_offsets: Vec<usize>§w_col_indices: Vec<usize>§w_values: Vec<i16>§n_neurons: usize§leak_k: i16§gain_k: i16§ext_lambda: f64§ext_weight_fp: i16§rng: Xoshiro256PlusPlusImplementations§
Source§impl BrunelNetwork
impl BrunelNetwork
Sourcepub fn new(
n_neurons: usize,
w_row_offsets: Vec<usize>,
w_col_indices: Vec<usize>,
w_values: Vec<i16>,
data_width: u32,
fraction: u32,
v_rest: i16,
v_reset: i16,
v_threshold: i16,
refractory_period: i32,
leak_k: i16,
gain_k: i16,
ext_lambda: f64,
ext_weight_fp: i16,
seed: u64,
) -> Result<Self, String>
pub fn new( n_neurons: usize, w_row_offsets: Vec<usize>, w_col_indices: Vec<usize>, w_values: Vec<i16>, data_width: u32, fraction: u32, v_rest: i16, v_reset: i16, v_threshold: i16, refractory_period: i32, leak_k: i16, gain_k: i16, ext_lambda: f64, ext_weight_fp: i16, seed: u64, ) -> Result<Self, String>
Build from CSR arrays and neuron parameters.
w_row_offsets: length n_neurons+1
w_col_indices, w_values: length nnz, values in Q8.8
Sourcepub fn run(&mut self, n_steps: usize) -> Vec<u32>
pub fn run(&mut self, n_steps: usize) -> Vec<u32>
Run n_steps of the full Brunel simulation. Returns spike counts per step.
pub fn total_spikes(&self, counts: &[u32]) -> u64
Auto Trait Implementations§
impl Freeze for BrunelNetwork
impl RefUnwindSafe for BrunelNetwork
impl Send for BrunelNetwork
impl Sync for BrunelNetwork
impl Unpin for BrunelNetwork
impl UnsafeUnpin for BrunelNetwork
impl UnwindSafe for BrunelNetwork
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> 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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.