Basic_synapses
[Synapses]


Data Structures

struct  aspi_basic_synapses_t
 Matrix structure. More...
struct  aspi_basic_synapses_class_t
 Matrix class structure. More...

Defines

#define ASPI_BASIC_SYNAPSES(x)   (aspi_object_check (x, aspi_basic_synapses ()), ((aspi_basic_synapses_t *) x))
#define ASPI_BASIC_SYNAPSES_CLASS(x)   (aspi_class_check (x, aspi_basic_synapses ()), ((aspi_basic_synapses_class_t *) x))

Functions

aspi_class_taspi_basic_synapses (void)
void aspi_basic_synapses_dtor (aspi_object_t *self)
aspi_object_taspi_basic_synapses_init (aspi_object_t *self, int n_neurons, double trace_leak)
double aspi_basic_synapses_get_weight (aspi_object_t *self, int pre, int post)
void aspi_basic_synapses_set_weight (aspi_object_t *self, int pre, int post, double value)
int aspi_basic_synapses_get_delay (aspi_object_t *self, int pre, int post)
void aspi_basic_synapses_set_delay (aspi_object_t *self, int pre, int post, int value)
double aspi_basic_synapses_get_trace (aspi_object_t *self, int pre, int post, int time)
void aspi_basic_synapses_add_to_trace (aspi_object_t *self, int pre, int post, double value, int time)
void aspi_basic_synapses_apply_callback_post (aspi_object_t *self, aspi_object_t *network, int i, aspi_callback_t callback, void *data)
 Apply a function to all synapses a neuron connects to.
void aspi_basic_synapses_apply_callback_pre (aspi_object_t *self, aspi_object_t *network, int j, aspi_callback_t callback, void *data)
 Apply a function to all synapses a neuron is connected.
void aspi_basic_synapses_apply_callback (aspi_object_t *self, aspi_object_t *network, aspi_callback_t callback, void *data)
 Apply a function to all synapses.

Detailed Description

Simple implementation of the Synapses class. This class uses full matrix, so it is good for fully connected networks. If the connectivity of the network is less than 66%, you should use Sparse_synapses instead.

Define Documentation

#define ASPI_BASIC_SYNAPSES (  )     (aspi_object_check (x, aspi_basic_synapses ()), ((aspi_basic_synapses_t *) x))

#define ASPI_BASIC_SYNAPSES_CLASS (  )     (aspi_class_check (x, aspi_basic_synapses ()), ((aspi_basic_synapses_class_t *) x))


Function Documentation

aspi_class_t * aspi_basic_synapses ( void   ) 

void aspi_basic_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_BASIC_SYNAPSES, aspi_return_if_fail, aspi_synapses_get_size(), aspi_synapses_get_trace_leak(), aspi_trace_t::last_update, aspi_basic_synapses_t::traces, and aspi_trace_t::value.

Referenced by aspi_basic_synapses().

void aspi_basic_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_basic_synapses_apply_callback_post(), and aspi_synapses_get_size().

Referenced by aspi_basic_synapses().

void aspi_basic_synapses_apply_callback_post ( aspi_object_t self,
aspi_object_t network,
int  i,
aspi_callback_t  callback,
void *  data 
)

void aspi_basic_synapses_apply_callback_pre ( aspi_object_t self,
aspi_object_t network,
int  j,
aspi_callback_t  callback,
void *  data 
)

void aspi_basic_synapses_dtor ( aspi_object_t self  ) 

int aspi_basic_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_BASIC_SYNAPSES, aspi_synapses_get_size(), and aspi_basic_synapses_t::delays.

Referenced by aspi_basic_synapses().

double aspi_basic_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_BASIC_SYNAPSES, aspi_synapses_get_size(), aspi_synapses_get_trace_leak(), aspi_trace_t::last_update, aspi_basic_synapses_t::traces, and aspi_trace_t::value.

Referenced by aspi_basic_synapses().

double aspi_basic_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_basic_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_BASIC_SYNAPSES, aspi_synapses_get_size(), and aspi_basic_synapses_t::weights.

Referenced by aspi_basic_synapses().

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

Basic 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_BASIC_SYNAPSES, aspi_basic_synapses(), aspi_class_instantiate(), aspi_return_value_if_fail, aspi_synapses_init(), aspi_basic_synapses_t::delays, aspi_basic_synapses_t::neurons, aspi_basic_synapses_t::traces, and aspi_basic_synapses_t::weights.

Referenced by aspi_basic_synapses().

void aspi_basic_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_BASIC_SYNAPSES, aspi_synapses_get_size(), and aspi_basic_synapses_t::delays.

Referenced by aspi_basic_synapses().

void aspi_basic_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_BASIC_SYNAPSES, aspi_synapses_get_size(), and aspi_basic_synapses_t::weights.

Referenced by aspi_basic_synapses().


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