Sparse_synapses
[Synapses]


Data Structures

struct  aspi_sparse_item_t
struct  aspi_sparse_synapses_t
 Matrix structure. More...
struct  aspi_sparse_synapses_class_t
 Matrix class structure. More...

Defines

#define ASPI_SPARSE_SYNAPSES(x)   (aspi_object_check (x, aspi_sparse_synapses ()), ((aspi_sparse_synapses_t *) x))
#define ASPI_SPARSE_SYNAPSES_CLASS(x)   (aspi_class_check (x, aspi_sparse_synapses ()), ((aspi_sparse_synapses_class_t *) x))

Functions

aspi_class_taspi_sparse_synapses (void)
void aspi_sparse_synapses_dtor (aspi_object_t *self)
aspi_object_taspi_sparse_synapses_init (aspi_object_t *self, int n_neurons, double trace_leak)
double aspi_sparse_synapses_get_weight (aspi_object_t *self, int pre, int post)
void aspi_sparse_synapses_set_weight (aspi_object_t *self, int pre, int post, double value)
int aspi_sparse_synapses_get_delay (aspi_object_t *self, int pre, int post)
void aspi_sparse_synapses_set_delay (aspi_object_t *self, int pre, int post, int value)
double aspi_sparse_synapses_get_trace (aspi_object_t *self, int pre, int post, int time)
void aspi_sparse_synapses_add_to_trace (aspi_object_t *self, int pre, int post, double value, int time)
void aspi_sparse_synapses_apply_callback (aspi_object_t *self, aspi_object_t *network, aspi_callback_t callback, void *data)
 Apply a function to all synapses.
void aspi_sparse_synapses_apply_callback_pre (aspi_object_t *self, aspi_object_t *network, int j, aspi_callback_t callback, void *data_to_pass)
 Apply a function to all pre-neuronal synapses.
void aspi_sparse_synapses_apply_callback_post (aspi_object_t *self, aspi_object_t *network, int i, aspi_callback_t callback, void *data_to_pass)
 Apply a function to all post-neuronal synapses.

Detailed Description

Sparse implementation of the Synapses class. This class uses sparse, so it should be both faster and take less memory in a network that has low connectivity

Define Documentation

#define ASPI_SPARSE_SYNAPSES (  )     (aspi_object_check (x, aspi_sparse_synapses ()), ((aspi_sparse_synapses_t *) x))

#define ASPI_SPARSE_SYNAPSES_CLASS (  )     (aspi_class_check (x, aspi_sparse_synapses ()), ((aspi_sparse_synapses_class_t *) x))


Function Documentation

aspi_class_t * aspi_sparse_synapses ( void   ) 

void aspi_sparse_synapses_add_to_trace ( aspi_object_t self,
int  pre,
int  post,
double  value,
int  time 
)

Update the synaptic trace with the current value

Parameters:
pre,: presynaptic neuron (number)
post,: postsynaptic neuron (number)
value,: value

References ASPI_SPARSE_SYNAPSES, aspi_synapses_get_trace_leak(), aspi_trace_t::last_update, aspi_sparse_synapses_t::n_items, aspi_sparse_synapses_t::traces, and aspi_trace_t::value.

Referenced by aspi_sparse_synapses().

void aspi_sparse_synapses_apply_callback ( aspi_object_t self,
aspi_object_t network,
aspi_callback_t  callback,
void *  data 
)

Apply a function to all synapses.

Apply the callback function to every synapses. The order is not necessarily ascending.

References aspi_sparse_synapses_apply_callback_post(), and aspi_synapses_get_size().

Referenced by aspi_sparse_synapses().

void aspi_sparse_synapses_apply_callback_post ( aspi_object_t self,
aspi_object_t network,
int  i,
aspi_callback_t  callback,
void *  data_to_pass 
)

void aspi_sparse_synapses_apply_callback_pre ( aspi_object_t self,
aspi_object_t network,
int  j,
aspi_callback_t  callback,
void *  data_to_pass 
)

void aspi_sparse_synapses_dtor ( aspi_object_t self  ) 

int aspi_sparse_synapses_get_delay ( aspi_object_t self,
int  pre,
int  post 
)

Return a synaptic delay between two synapses

Parameters:
pre,: presynaptic neuron (number)
post,: postsynaptic neuron (number)
The basic idea of this implementation is that we look at the presynaptic neuron and look at all postsynaptics to see if it is connected or not. It can actually be pretty slow...

References ASPI_SPARSE_SYNAPSES, and aspi_sparse_synapses_t::delays.

Referenced by aspi_sparse_synapses().

double aspi_sparse_synapses_get_trace ( aspi_object_t self,
int  pre,
int  post,
int  time 
)

Return a synaptic trace between two synapses

Parameters:
pre,: presynaptic neuron (number)
post,: postsynaptic neuron (number)
The basic idea of this implementation is that we look at the presynaptic neuron and look at all postsynaptics to see if it is connected or not. It can actually be pretty slow...

References ASPI_SPARSE_SYNAPSES, aspi_synapses_get_trace_leak(), aspi_trace_t::last_update, aspi_sparse_synapses_t::traces, and aspi_trace_t::value.

Referenced by aspi_sparse_synapses().

double aspi_sparse_synapses_get_weight ( aspi_object_t self,
int  pre,
int  post 
)

Return a synaptic weight between two synapses

Parameters:
pre,: presynaptic neuron (number)
post,: postsynaptic neuron (number)
The basic idea of this implementation is that we look at the presynaptic neuron and look at all postsynaptics to see if it is connected or not. It can actually be pretty slow...

References ASPI_SPARSE_SYNAPSES, and aspi_sparse_synapses_t::weights.

Referenced by aspi_sparse_synapses().

aspi_object_t * aspi_sparse_synapses_init ( aspi_object_t self,
int  n_neurons,
double  trace_leak 
)

Sparse synapses initializer

Parameters:
self,: already alloced synapses or NULL
n_neurons,: total number of neurons
trace_leak,: -XXX or 0 to disable leak, or a number between 0 and 1 to set trace leak. Behaviour is undetermined if number > 1
Note on delays: there are no delays by default. They are created if necessary. If delays stay to zero, delays matrices stay NULL.

References aspi_class_instantiate(), aspi_return_value_if_fail, ASPI_SPARSE_SYNAPSES, aspi_sparse_synapses(), aspi_synapses_init(), aspi_sparse_synapses_t::delays, aspi_sparse_synapses_t::items_post, aspi_sparse_synapses_t::items_pre, aspi_sparse_synapses_t::n_items, aspi_sparse_synapses_t::sizes_post, aspi_sparse_synapses_t::sizes_pre, aspi_sparse_synapses_t::traces, and aspi_sparse_synapses_t::weights.

Referenced by aspi_sparse_synapses().

void aspi_sparse_synapses_set_delay ( aspi_object_t self,
int  pre,
int  post,
int  value 
)

Set a synaptic delay between two synapses

Parameters:
pre,: presynaptic neuron (number)
post,: postsynaptic neuron (number)
value,: value
The implementation is a bit tricky since we need to realloc weight if it was 0.

References ASPI_SPARSE_SYNAPSES, aspi_sparse_synapses_t::delays, and aspi_sparse_synapses_t::n_items.

Referenced by aspi_sparse_synapses().

void aspi_sparse_synapses_set_weight ( aspi_object_t self,
int  pre,
int  post,
double  value 
)

Set a synaptic weight between two synapses

Parameters:
pre,: presynaptic neuron (number)
post,: postsynaptic neuron (number)
value,: value
The implementation is a bit tricky since we need to realloc weight if it was 0.

References ASPI_SPARSE_SYNAPSES, and aspi_sparse_synapses_t::weights.

Referenced by aspi_sparse_synapses().


Generated on Wed Aug 19 01:16:49 2009 for aspirenn by  doxygen 1.5.5