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_t * | aspi_sparse_synapses (void) |
void | aspi_sparse_synapses_dtor (aspi_object_t *self) |
aspi_object_t * | aspi_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. |
#define ASPI_SPARSE_SYNAPSES | ( | x | ) | (aspi_object_check (x, aspi_sparse_synapses ()), ((aspi_sparse_synapses_t *) x)) |
Referenced by aspi_sparse_synapses_add_to_trace(), aspi_sparse_synapses_apply_callback_post(), aspi_sparse_synapses_apply_callback_pre(), aspi_sparse_synapses_dtor(), aspi_sparse_synapses_get_delay(), aspi_sparse_synapses_get_trace(), aspi_sparse_synapses_get_weight(), aspi_sparse_synapses_init(), aspi_sparse_synapses_set_delay(), and aspi_sparse_synapses_set_weight().
#define ASPI_SPARSE_SYNAPSES_CLASS | ( | x | ) | (aspi_class_check (x, aspi_sparse_synapses ()), ((aspi_sparse_synapses_class_t *) x)) |
aspi_class_t * aspi_sparse_synapses | ( | void | ) |
Get sparse synapses class
References aspi_class_register(), aspi_sparse_synapses_add_to_trace(), aspi_sparse_synapses_apply_callback(), aspi_sparse_synapses_apply_callback_post(), aspi_sparse_synapses_apply_callback_pre(), aspi_sparse_synapses_dtor(), aspi_sparse_synapses_get_delay(), aspi_sparse_synapses_get_trace(), aspi_sparse_synapses_get_weight(), aspi_sparse_synapses_init(), aspi_sparse_synapses_set_delay(), aspi_sparse_synapses_set_weight(), aspi_synapses(), ASPI_SYNAPSES_CLASS, and _aspi_class::id.
Referenced by aspi_sparse_synapses_init().
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
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 | |||
) |
Apply a function to all post-neuronal synapses.
References ASPI_NETWORK, ASPI_SPARSE_SYNAPSES, aspi_sparse_item_t::data, aspi_synapse_t::delay, aspi_sparse_synapses_t::delays, aspi_sparse_synapses_t::items_post, aspi_sparse_item_t::neuron, aspi_network_t::neurons, aspi_synapse_t::post, aspi_synapse_t::pre, aspi_sparse_synapses_t::sizes_post, aspi_synapse_t::trace, aspi_sparse_synapses_t::traces, aspi_synapse_t::weight, and aspi_sparse_synapses_t::weights.
Referenced by aspi_sparse_synapses(), and aspi_sparse_synapses_apply_callback().
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.
References ASPI_NETWORK, ASPI_SPARSE_SYNAPSES, aspi_sparse_item_t::data, aspi_synapse_t::delay, aspi_sparse_synapses_t::delays, aspi_sparse_synapses_t::items_pre, aspi_sparse_item_t::neuron, aspi_network_t::neurons, aspi_synapse_t::post, aspi_synapse_t::pre, aspi_sparse_synapses_t::sizes_pre, aspi_synapse_t::trace, aspi_sparse_synapses_t::traces, aspi_synapse_t::weight, and aspi_sparse_synapses_t::weights.
Referenced by aspi_sparse_synapses().
void aspi_sparse_synapses_dtor | ( | aspi_object_t * | self | ) |
Sparse synapses destructor
References ASPI_SPARSE_SYNAPSES, aspi_synapses_dtor(), aspi_synapses_get_size(), aspi_sparse_synapses_t::delays, aspi_sparse_synapses_t::items_post, aspi_sparse_synapses_t::items_pre, 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().
int aspi_sparse_synapses_get_delay | ( | aspi_object_t * | self, | |
int | pre, | |||
int | post | |||
) |
Return a synaptic delay between two synapses
pre,: | presynaptic neuron (number) | |
post,: | postsynaptic neuron (number) |
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
pre,: | presynaptic neuron (number) | |
post,: | postsynaptic neuron (number) |
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
pre,: | presynaptic neuron (number) | |
post,: | postsynaptic neuron (number) |
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
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 |
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
pre,: | presynaptic neuron (number) | |
post,: | postsynaptic neuron (number) | |
value,: | value |
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
pre,: | presynaptic neuron (number) | |
post,: | postsynaptic neuron (number) | |
value,: | value |
References ASPI_SPARSE_SYNAPSES, and aspi_sparse_synapses_t::weights.
Referenced by aspi_sparse_synapses().