pub struct SpikingNetwork {
pub config: NetworkConfig,
/* private fields */
}Expand description
A spiking neural network
Fields§
§config: NetworkConfigConfiguration
Implementations§
Source§impl SpikingNetwork
impl SpikingNetwork
Sourcepub fn new(config: NetworkConfig) -> Self
pub fn new(config: NetworkConfig) -> Self
Create a new spiking network from configuration
Sourcepub fn from_graph(graph: &DynamicGraph, config: NetworkConfig) -> Self
pub fn from_graph(graph: &DynamicGraph, config: NetworkConfig) -> Self
Create network with topology matching a graph
Sourcepub fn num_layers(&self) -> usize
pub fn num_layers(&self) -> usize
Get number of layers
Sourcepub fn layer_size(&self, layer: usize) -> usize
pub fn layer_size(&self, layer: usize) -> usize
Get layer size
Sourcepub fn current_time(&self) -> SimTime
pub fn current_time(&self) -> SimTime
Get current simulation time
Sourcepub fn inject_current(&mut self, currents: &[f64])
pub fn inject_current(&mut self, currents: &[f64])
Inject current to input layer
Sourcepub fn run_until_decision(&mut self, max_steps: usize) -> Vec<Spike>
pub fn run_until_decision(&mut self, max_steps: usize) -> Vec<Spike>
Run until a decision is made (output neuron spikes)
Sourcepub fn layer_rate(&self, layer: usize, window: f64) -> f64
pub fn layer_rate(&self, layer: usize, window: f64) -> f64
Get population firing rate for a layer
Sourcepub fn global_synchrony(&self) -> f64
pub fn global_synchrony(&self) -> f64
Get global synchrony
Sourcepub fn synchrony_matrix(&self) -> Vec<Vec<f64>>
pub fn synchrony_matrix(&self) -> Vec<Vec<f64>>
Get synchrony matrix (pairwise correlation)
Sourcepub fn get_output(&self) -> Vec<f64>
pub fn get_output(&self) -> Vec<f64>
Get output layer activities
Sourcepub fn apply_reward(&mut self, reward: f64)
pub fn apply_reward(&mut self, reward: f64)
Apply reward signal for R-STDP
Sourcepub fn low_activity_regions(&self) -> Vec<usize>
pub fn low_activity_regions(&self) -> Vec<usize>
Get low-activity regions (for search skip optimization)
Sourcepub fn sync_to_graph(&self, graph: &mut DynamicGraph)
pub fn sync_to_graph(&self, graph: &mut DynamicGraph)
Sync first layer weights back to graph
Trait Implementations§
Source§impl Clone for SpikingNetwork
impl Clone for SpikingNetwork
Source§fn clone(&self) -> SpikingNetwork
fn clone(&self) -> SpikingNetwork
Returns a duplicate of the value. Read more
1.0.0 · 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 SpikingNetwork
impl RefUnwindSafe for SpikingNetwork
impl Send for SpikingNetwork
impl Sync for SpikingNetwork
impl Unpin for SpikingNetwork
impl UnwindSafe for SpikingNetwork
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 more