Network
[Object]


Modules

 Network_ml

Data Structures

struct  aspi_network_t
 Network structure. More...
struct  aspi_network_class_t
 Network class structure. More...
struct  aspi_efficiency

Defines

#define ASPI_NETWORK(x)   (aspi_object_check (x, aspi_network ()), ((aspi_network_t *) x))
#define ASPI_NETWORK_CLASS(x)   (aspi_class_check (x, aspi_network ()), ((aspi_network_class_t * ) x))

Functions

aspi_class_taspi_network (void)
void aspi_network_dtor (aspi_object_t *self)
aspi_object_taspi_network_init (aspi_object_t *self, aspi_class_t *neuron_model, int neurons)
aspi_object_taspi_network_init_full (aspi_object_t *self, aspi_class_t *model, aspi_class_t *synapse_model, int neurons)
int aspi_network_get_size (aspi_object_t *self)
int aspi_network_get_time (aspi_object_t *self)
void aspi_network_set_weight (aspi_object_t *self, int pre, int post, double weight)
double aspi_network_get_weight (aspi_object_t *self, int pre, int post)
unsigned int aspi_network_get_delay (aspi_object_t *self, int pre, int post)
void aspi_network_set_delay (aspi_object_t *self, int pre, int post, unsigned int delay)
void aspi_network_calc_max_delays (aspi_object_t *self)
void aspi_network_act (aspi_object_t *self)
 Monothread implementation of act method.
aspi_object_taspi_network_get_neuron (aspi_object_t *self, unsigned int n)
 Return the nthn neuron.
int aspi_network_get_neuron_index (aspi_object_t *self, aspi_object_t *neuron)
aspi_object_t ** aspi_network_get_neurons (aspi_object_t *self)
 Return all neurons in the interval.
void aspi_network_set_rule (aspi_object_t *self, aspi_learning_rule_t learn_func)
double aspi_network_get_avg_v (aspi_object_t *self)
void aspi_network_learn_ranged (aspi_object_t *self, double alpha_plus, double alpha_neg, int from_begin, int from_end, int to_begin, int to_end)
void aspi_network_learn (aspi_object_t *self, double alpha_plus, double alpha_neg)
aspi_object_taspi_network_dup (aspi_object_t *self)
int * aspi_network_get_node_degrees (aspi_object_t *self)
double * aspi_network_get_node_strengths (aspi_object_t *self)
double aspi_network_get_cluster (aspi_object_t *self)
struct aspi_efficiency aspi_network_get_efficiency (aspi_object_t *self)
double aspi_network_get_freq_skewness (aspi_object_t *self)
double aspi_network_get_freq_kurtosis (aspi_object_t *self)

Detailed Description

This is the main class, used for all and multithreads networks.

The network can handle various neuron's models and learning rules.


Define Documentation

#define ASPI_NETWORK (  )     (aspi_object_check (x, aspi_network ()), ((aspi_network_t *) x))

#define ASPI_NETWORK_CLASS (  )     (aspi_class_check (x, aspi_network ()), ((aspi_network_class_t * ) x))


Function Documentation

aspi_class_t * aspi_network ( void   ) 

void aspi_network_act ( aspi_object_t self  ) 

Monothread implementation of act method.

This method run one time step. This one doesn't support multithread..

References ASPI_NETWORK, aspi_neuron_class_act(), and aspi_network_t::model.

void aspi_network_calc_max_delays ( aspi_object_t self  ) 

Alloc necessary memory for delays

This method should be called after last call to set_delay, since it used it.

You better use a method that wraps set_delay and this one.

References ASPI_NETWORK, aspi_neuron_class_reinit(), and aspi_network_t::model.

Referenced by aspi_network_ml_init_poisson(), and aspi_network_ml_init_sparse().

void aspi_network_dtor ( aspi_object_t self  ) 

aspi_object_t * aspi_network_dup ( aspi_object_t self  ) 

Copy the network

This method send a new copy of the network that shares nearly everything with the precedent ; except the individual neurons.

Note that the weights, delays, etc. are shared. So it might not be a good idea to apply STDP to different networks

This method actually mainly do a copy of the data, except that we do some alloc' and retain.

Theoretically, cloning a network_ml should send a network_ml back.

References ASPI_NETWORK, aspi_network_get_size(), aspi_neuron_class_reinit(), ASPI_OBJECT, aspi_object_copy(), aspi_object_dup(), aspi_object_retain(), aspi_return_value_if_fail, aspi_network_t::model, aspi_network_t::neurons, and aspi_network_t::synapses.

Referenced by aspi_network(), and aspi_network_ml_dup().

double aspi_network_get_avg_v ( aspi_object_t self  ) 

Return the average voltage of the network

References ASPI_NETWORK, aspi_network_get_size(), aspi_neuron_get_v(), and aspi_network_t::neurons.

double aspi_network_get_cluster ( aspi_object_t self  ) 

Get weighted clustering coefficient Use the weighted clustering way of computing it of onnela05

References aspi_network_get_node_degrees(), aspi_network_get_node_strengths(), aspi_network_get_size(), and aspi_network_get_weight().

unsigned int aspi_network_get_delay ( aspi_object_t self,
int  pre,
int  post 
)

Get a synapse 's delay

return 1 if delays has not been alloc'ed

Get a synapse's delay

References ASPI_NETWORK, aspi_synapses_get_delay(), and aspi_network_t::synapses.

struct aspi_efficiency aspi_network_get_efficiency ( aspi_object_t self  )  [read]

Get «efficiency» measures (used to see if a network is small-world or not, see [Latora, Marchiori 2001]

Parameters:
self,: the network
eloc,: pointer to an alloced double
eglob,: pointer to an alloced double

References aspi_network_get_size(), aspi_network_get_weight(), aspi_efficiency::eglob, and aspi_efficiency::eloc.

double aspi_network_get_freq_kurtosis ( aspi_object_t self  ) 

Return frequency kurtosis Only works for Leaky neurons

It seems that code could be factorised from get_skewness, but it must also be independent function, so i shall investigate later.

References aspi_leaky(), aspi_leaky_get_freq(), aspi_network_get_neuron(), aspi_network_get_size(), aspi_object_is_a(), and aspi_return_value_if_fail.

double aspi_network_get_freq_skewness ( aspi_object_t self  ) 

Return frequency skewness Only works for Leaky neurons

References aspi_leaky(), aspi_leaky_get_freq(), aspi_network_get_neuron(), aspi_network_get_size(), aspi_object_is_a(), and aspi_return_value_if_fail.

aspi_object_t * aspi_network_get_neuron ( aspi_object_t self,
unsigned int  n 
)

int aspi_network_get_neuron_index ( aspi_object_t self,
aspi_object_t neuron 
)

Return the index of a neuron, or -1 if not in the network

References ASPI_NETWORK, aspi_network_get_size(), and aspi_network_t::neurons.

aspi_object_t ** aspi_network_get_neurons ( aspi_object_t self  ) 

Return all neurons in the interval.

Return a array of all neurons. The array is dynamically alloced and must thus be freed ; however, neurons must not: the network take care of them.

References aspi_network_get_neuron(), and aspi_network_get_size().

int * aspi_network_get_node_degrees ( aspi_object_t self  ) 

Get node degrees, ie the number of non-null outgoing weights

Returns:
an array of size elements, which shall be freed

References aspi_network_get_size(), and aspi_network_get_weight().

Referenced by aspi_network_get_cluster().

double * aspi_network_get_node_strengths ( aspi_object_t self  ) 

Get node strengths, similar to degrees, but weighted

We use abs(wij) so all strengths are not around zero

Returns:
a table of size elements, which shall be free()d.

References aspi_network_get_size(), and aspi_network_get_weight().

Referenced by aspi_network_get_cluster().

int aspi_network_get_size ( aspi_object_t self  ) 

int aspi_network_get_time ( aspi_object_t self  ) 

Get the time

References ASPI_NETWORK, and aspi_network_t::time.

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

aspi_object_t * aspi_network_init ( aspi_object_t self,
aspi_class_t neuron_model,
int  neurons 
)

Simple network initializer

Init a network with basic synapses.

See also:
aspi_network_init_full

References aspi_basic_synapses(), and aspi_network_init_full().

aspi_object_t * aspi_network_init_full ( aspi_object_t self,
aspi_class_t model,
aspi_class_t synapse_model,
int  neurons 
)

Network initializer

Parameters:
self : an alloced network, or NULL
model : neuron model
synapse_model,: synaptic model (basic_synapses or sparse_synapses)
neurons : number of neurons of the network

References aspi_class_instantiate(), ASPI_NETWORK, aspi_network(), aspi_neuron_class_reinit(), aspi_object_init(), aspi_synapses_init_generic(), DEFAULT_LEARN_FUNC, aspi_network_t::learn_func, aspi_network_t::model, aspi_network_t::neurons, aspi_network_t::number_neurons, aspi_network_t::synapses, and aspi_network_t::time.

Referenced by aspi_network_init(), and aspi_network_ml_init_sparse().

void aspi_network_learn ( aspi_object_t self,
double  alpha_plus,
double  alpha_neg 
)

Learn

Apply the learning rule to all neurons

References aspi_network_get_size(), and aspi_network_learn_ranged().

void aspi_network_learn_ranged ( aspi_object_t self,
double  alpha_plus,
double  alpha_neg,
int  from_begin,
int  from_end,
int  to_begin,
int  to_end 
)

Learn

Apply the learning rule to the neurons from to last

References ASPI_NETWORK, aspi_return_if_fail, and aspi_network_t::learn_func.

Referenced by aspi_network_learn().

void aspi_network_set_delay ( aspi_object_t self,
int  pre,
int  post,
unsigned int  delay 
)

Set a synapse's delay

If delays have not been initialized, we alloc it. It is not alloc'ed by default since a 0 delay net doesn't need it

References ASPI_NETWORK, aspi_synapses_set_delay(), and aspi_network_t::synapses.

Referenced by aspi_network_ml_init_poisson(), and aspi_network_ml_init_sparse().

void aspi_network_set_rule ( aspi_object_t self,
aspi_learning_rule_t  learn_func 
)

Change the netork's learning rule

References ASPI_NETWORK, and aspi_network_t::learn_func.

void aspi_network_set_weight ( aspi_object_t self,
int  pre,
int  post,
double  weight 
)

Set a synapse's weight

Set a synapse's weight

References ASPI_NETWORK, aspi_synapses_set_weight(), and aspi_network_t::synapses.

Referenced by aspi_network_ml_init_sparse().


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