Synapses
[Object]


Modules

 Basic_synapses
 Sparse_synapses

Data Structures

struct  aspi_synapses_t
 Synaptic matrix structure. More...
struct  aspi_synapses_class_t
 Synapses class stucture. More...

Defines

#define ASPI_SYNAPSES(x)   (aspi_object_check (x, aspi_synapses ()), ((aspi_synapses_t *) x))
#define ASPI_SYNAPSES_CLASS(x)   (aspi_class_check (x, aspi_synapses ()), ((aspi_synapses_class_t *) x))

Functions

aspi_class_taspi_synapses (void)
void aspi_synapses_dtor (aspi_object_t *self)
aspi_object_taspi_synapses_init (aspi_object_t *self, int n_neurons, double trace_leak)
aspi_object_taspi_synapses_init_generic (aspi_class_t *klass, aspi_object_t *self, int n_neurons, double trace_leak)
int aspi_synapses_get_size (aspi_object_t *self)
double aspi_synapses_get_trace_leak (aspi_object_t *self)
double aspi_synapses_get_weight (aspi_object_t *self, int pre, int post)
void aspi_synapses_set_weight (aspi_object_t *self, int pre, int post, double value)
int aspi_synapses_get_delay (aspi_object_t *self, int pre, int post)
void aspi_synapses_set_delay (aspi_object_t *self, int pre, int post, int value)
double aspi_synapses_get_trace (aspi_object_t *self, int pre, int post, int time)
void aspi_synapses_add_to_trace (aspi_object_t *self, int pre, int post, double value, int time)
void aspi_synapses_apply_callback_post (aspi_object_t *self, aspi_object_t *net, int neuron, aspi_callback_t callback, void *data)
 Apply a function to all synapses a neuron leads to.
void aspi_synapses_apply_callback_pre (aspi_object_t *self, aspi_object_t *net, int neuron, aspi_callback_t callback, void *data)
 Apply a function to all synapses a neuron leads to.
void aspi_synapses_apply_callback (aspi_object_t *self, aspi_object_t *net, aspi_callback_t callback, void *data)
 Apply a function to all synapses.

Detailed Description

Abstract class for the API for the synaptic matrices.

This API is implemented by two classes: basic_synapses and sparse_synapses. The first one should take less memory in full matrixes, while the latter should be more efficient with sparse matrixes (< 2/3 weights = 0)

In order to use this matrix:

for (i = 0; i < aspi_synapses_get_size (mat); i++) { double * w = aspi_synapses_get_post_weights (mat, i); int * d = aspi_synapses_get_post_delays (mat, i); int * n = aspi_synapses_get_post_neurons (mat, i); for (j = 0; j < aspi_synapses_get_post_size (mat, i); j++) // do what you want with w[j] and d[j], and n[j] }


Define Documentation

#define ASPI_SYNAPSES (  )     (aspi_object_check (x, aspi_synapses ()), ((aspi_synapses_t *) x))

#define ASPI_SYNAPSES_CLASS (  )     (aspi_class_check (x, aspi_synapses ()), ((aspi_synapses_class_t *) x))


Function Documentation

aspi_class_t * aspi_synapses ( void   ) 

void aspi_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_return_if_fail, and ASPI_SYNAPSES_CLASS.

void aspi_synapses_apply_callback ( aspi_object_t self,
aspi_object_t net,
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_return_if_fail, and ASPI_SYNAPSES_CLASS.

void aspi_synapses_apply_callback_post ( aspi_object_t self,
aspi_object_t net,
int  neuron,
aspi_callback_t  callback,
void *  data 
)

Apply a function to all synapses a neuron leads to.

References aspi_return_if_fail, and ASPI_SYNAPSES_CLASS.

void aspi_synapses_apply_callback_pre ( aspi_object_t self,
aspi_object_t net,
int  neuron,
aspi_callback_t  callback,
void *  data 
)

Apply a function to all synapses a neuron leads to.

References aspi_return_if_fail, and ASPI_SYNAPSES_CLASS.

void aspi_synapses_dtor ( aspi_object_t self  ) 

Synapses destructor

References aspi_object_dtor().

Referenced by aspi_basic_synapses_dtor(), aspi_sparse_synapses_dtor(), and aspi_synapses().

int aspi_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)

References aspi_return_value_if_fail, and ASPI_SYNAPSES_CLASS.

Referenced by aspi_network_get_delay().

int aspi_synapses_get_size ( aspi_object_t self  ) 

double aspi_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)

References aspi_return_value_if_fail, and ASPI_SYNAPSES_CLASS.

double aspi_synapses_get_trace_leak ( aspi_object_t self  ) 

double aspi_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)
Note that this can be implemented via sparse matrix, so doing for (i = 0; i <= N; i++) for (j = 0; j < N; j++) w = aspi_synapses_get_weight (syn, i, j) ...

could be quite not good. Try

for (i = 0; i <= N; i++) { w = aspi_synapses_get_post_weight (syn, i); for (j = 0; j < aspi_synapses_get_post_size (syn, i); j++) ... }

References aspi_return_value_if_fail, and ASPI_SYNAPSES_CLASS.

Referenced by aspi_network_get_weight().

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

Synapses initiazer

This create only a few things, and should be completed by derived classed.

This method should not be used directly, but rather aspi_synapses_init_generic or aspi_derived_synapses_init.

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_object_init(), ASPI_SYNAPSES, aspi_synapses(), aspi_synapses_t::leak, and aspi_synapses_t::number_neurons.

Referenced by aspi_basic_synapses_init(), aspi_sparse_synapses_init(), and aspi_synapses().

aspi_object_t * aspi_synapses_init_generic ( aspi_class_t klass,
aspi_object_t self,
int  n_neurons,
double  trace_leak 
)

Generic initializer method

Call the init method of the class passed in parameter.

References aspi_return_value_if_fail, ASPI_SYNAPSES_CLASS, and aspi_synapses_class_t::init.

Referenced by aspi_network_init_full().

void aspi_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

References aspi_return_if_fail, and ASPI_SYNAPSES_CLASS.

Referenced by aspi_network_set_delay().

void aspi_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

References aspi_return_if_fail, and ASPI_SYNAPSES_CLASS.

Referenced by aspi_network_set_weight().


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