This class implement a leaky integrate-and-fire neuron which can manage its delays
#define ASPI_LEAKY | ( | x | ) | (aspi_object_check (x, aspi_leaky ()), ((aspi_leaky_t *) x)) |
Referenced by aspi_leaky_add_in_n_steps(), aspi_leaky_dtor(), aspi_leaky_dup(), aspi_leaky_fire(), aspi_leaky_get_freq(), aspi_leaky_get_last_spike_before(), aspi_leaky_get_threshold(), aspi_leaky_get_threshold_ip(), aspi_leaky_get_v_trace(), aspi_leaky_get_v_trace_at(), aspi_leaky_get_voltage(), aspi_leaky_has_fired(), aspi_leaky_init(), aspi_leaky_set_last_spike(), aspi_leaky_set_max_delay(), aspi_leaky_set_memory(), aspi_leaky_set_threshold(), and aspi_leaky_update_voltage().
#define ASPI_LEAKY_CLASS | ( | x | ) | (aspi_class_check (x, aspi_leaky ()), ((aspi_leaky_class_t * ) x)) |
aspi_class_t * aspi_leaky | ( | void | ) |
Get leaky class
References aspi_neuron_class_t::act, aspi_class_register(), aspi_leaky_dtor(), aspi_leaky_dup(), aspi_neuron(), ASPI_NEURON_CLASS, _aspi_class::dup, _aspi_class::id, and aspi_neuron_class_t::reinit.
Referenced by aspi_leaky_init(), aspi_network_get_freq_kurtosis(), and aspi_network_get_freq_skewness().
void aspi_leaky_add_in_n_steps | ( | aspi_object_t * | self, | |
double | voltage, | |||
int | steps | |||
) |
Do v += x, but in n steps.
If steps > max_delay, we do nothing
References ASPI_LEAKY, aspi_return_if_fail, aspi_leaky_t::futur_voltages_exci, aspi_leaky_t::futur_voltages_inhib, aspi_leaky_t::max_delay, and aspi_leaky_t::vindex.
int aspi_leaky_class_get_refractory | ( | void | ) |
Get refractory period
double aspi_leaky_class_get_threshold | ( | void | ) |
Get class threshold
void aspi_leaky_class_set_dynamic_threshold | ( | int | dynamic_threshold | ) |
Set / unset dynamic threshold
set_dynamic_threshold,: | 1 to activate dynamic threshold |
void aspi_leaky_class_set_ip | ( | int | set_ip | ) |
Set / unset short term plasticity
set_ip,: | 1 to activate Intrinsic Plasticity, 0 to turn it off |
Thus, it ensures that the effective weights' standard deviation is keeped the same : it has an homeostatic effect.
void aspi_leaky_class_set_ip_factor | ( | double | ip_factor | ) |
Set IP factor
If IP is used, it is used as a power multiplying standard deviation
void aspi_leaky_class_set_leak | ( | double | leak | ) |
Set leak (default = 0.9)
void aspi_leaky_class_set_noise | ( | double | noise | ) |
Set noise (default = 0.0)
void aspi_leaky_class_set_refractory | ( | int | refractory | ) |
Set refractory period (default = 0)
void aspi_leaky_class_set_rest_voltage | ( | double | rest | ) |
Set rest voltage (default = 0.0)
void aspi_leaky_class_set_stp | ( | int | set_stp | ) |
Set / unset short term plasticity
set_stp,: | 1 to activate STP, 0 to deactivate it. |
This way, a synapse's efficacy decreases when it is used and increase when it isn't.
void aspi_leaky_class_set_threshold | ( | double | threshold | ) |
Set threshold (default = 1.0)
void aspi_leaky_class_set_threshold_leak | ( | double | leak | ) |
Set a neuron's threshold leak
Only used if the dynamic threshold is used.
void aspi_leaky_dtor | ( | aspi_object_t * | self | ) |
Leaky destructor
References ASPI_LEAKY, aspi_neuron_dtor(), aspi_leaky_t::futur_voltages_exci, aspi_leaky_t::futur_voltages_inhib, aspi_leaky_t::last_spike, aspi_leaky_t::max_delay, aspi_leaky_t::memory, and aspi_leaky_t::v_traces.
Referenced by aspi_leaky().
aspi_object_t * aspi_leaky_dup | ( | aspi_object_t * | self | ) |
Copy method
Deep-copy of the neuron's data
References ASPI_LEAKY, aspi_leaky_set_max_delay(), aspi_leaky_set_memory(), aspi_object_dup(), aspi_leaky_t::futur_voltages_exci, aspi_leaky_t::futur_voltages_inhib, aspi_leaky_t::last_spike, aspi_leaky_t::max_delay, aspi_leaky_t::memory, aspi_leaky_t::network, and aspi_leaky_t::v_traces.
Referenced by aspi_leaky().
void aspi_leaky_fire | ( | aspi_object_t * | self | ) |
Make a neuron fire.
This is done by setting its last fire time to next time and ressetting membrane voltage.
References ASPI_LEAKY, aspi_leaky_set_last_spike(), ASPI_NETWORK, aspi_neuron_set_v(), aspi_leaky_t::network, aspi_leaky_t::threshold, and aspi_network_t::time.
double aspi_leaky_get_freq | ( | aspi_object_t * | self | ) |
Return leaky's frequence
Actually, it corresponds to a trace of the neuron's activity
References ASPI_LEAKY, and aspi_leaky_t::freq.
Referenced by aspi_network_get_freq_kurtosis(), and aspi_network_get_freq_skewness().
int aspi_leaky_get_last_spike | ( | aspi_object_t * | self | ) |
Same as aspi_leaky_get_last_spike_before, with before = 0
References aspi_leaky_get_last_spike_before().
Referenced by aspi_leaky_has_fired(), and aspi_leaky_update_voltage().
int aspi_leaky_get_last_spike_before | ( | aspi_object_t * | self, | |
int | before | |||
) |
Get last spike (if before = 0), or last spike before BEFORE (before should be set to (t - delay) )
Also note that if before is set and there is no last spike before this date, then -1 is returned.
References ASPI_LEAKY, aspi_leaky_t::index, aspi_leaky_t::last_spike, and aspi_leaky_t::memory.
Referenced by aspi_leaky_get_last_spike(), and aspi_leaky_has_fired_at().
double aspi_leaky_get_threshold | ( | aspi_object_t * | self | ) |
Get a neuron's threshold
Return the threshold of a given neuron.
References ASPI_LEAKY, and aspi_leaky_t::threshold.
double aspi_leaky_get_threshold_ip | ( | aspi_object_t * | self | ) |
Update a neuron's threshold for intrinsic plasticity
(According to standard deviation of weights incoming to the neuron)
References ASPI_LEAKY, ASPI_NETWORK, aspi_leaky_t::network, aspi_leaky_t::std_dev_ip_current, aspi_leaky_t::std_dev_ip_init, aspi_leaky_t::threshold, and aspi_network_t::time.
Referenced by aspi_leaky_update_voltage().
double aspi_leaky_get_v_trace | ( | aspi_object_t * | self | ) |
This method returns the current v_trace of the neuron.
References ASPI_LEAKY, aspi_leaky_get_v_trace_at(), and ASPI_NETWORK.
double aspi_leaky_get_v_trace_at | ( | aspi_object_t * | self, | |
int | time | |||
) |
This method returns the v_trace at time t.
It only works if t is in the memory of the neuron ; else 0.0 is returned.
time,: | network's time |
References ASPI_LEAKY, ASPI_NETWORK, aspi_return_value_if_fail, aspi_leaky_t::memory, aspi_leaky_t::network, aspi_network_t::time, and aspi_leaky_t::v_traces.
Referenced by aspi_leaky_get_v_trace().
double aspi_leaky_get_voltage | ( | aspi_object_t * | self | ) |
Returns the voltage of the neuron.
References ASPI_LEAKY, aspi_leaky_has_fired(), aspi_neuron_get_v(), and aspi_leaky_t::max_delay.
int aspi_leaky_has_fired | ( | aspi_object_t * | self | ) |
Tells whether the neuron has fired last step
References ASPI_LEAKY, aspi_leaky_get_last_spike(), ASPI_NETWORK, aspi_leaky_t::network, and aspi_network_t::time.
Referenced by aspi_leaky_get_voltage().
int aspi_leaky_has_fired_at | ( | aspi_object_t * | self, | |
int | time | |||
) |
Tells whether the neuron fired at step t. As you might guess, it is not always possible to tell. So the result is :
References aspi_leaky_get_last_spike_before().
aspi_object_t * aspi_leaky_init | ( | aspi_object_t * | self | ) |
Leaky constructor
Memory and max_delay are set to 0
References aspi_class_instantiate(), ASPI_LEAKY, aspi_leaky(), aspi_leaky_set_memory(), aspi_leaky_t::futur_voltages_exci, aspi_leaky_t::futur_voltages_inhib, aspi_leaky_t::index, aspi_leaky_t::last_spike, aspi_leaky_t::max_delay, aspi_leaky_t::memory, aspi_leaky_t::std_dev_ip_current, aspi_leaky_t::std_dev_ip_init, aspi_leaky_t::threshold, aspi_leaky_t::v_traces, and aspi_leaky_t::vindex.
Referenced by aspi_leaky_init_full().
aspi_object_t * aspi_leaky_init_full | ( | aspi_object_t * | self, | |
int | memory, | |||
int | delay | |||
) |
Leaky constructor - full
If memory is set, last_spike buffer is alloc'ed, else it is set to zero. Same thing for max_delay and futur_voltages buffer
References aspi_leaky_init(), aspi_leaky_set_max_delay(), and aspi_leaky_set_memory().
void aspi_leaky_set_last_spike | ( | aspi_object_t * | self, | |
int | time | |||
) |
Set the last spike for a neuron.
Note that it is assumed that when you call this method 2 times, t2 > t1
References ASPI_LEAKY, aspi_leaky_t::index, aspi_leaky_t::last_spike, and aspi_leaky_t::memory.
Referenced by aspi_leaky_fire(), and aspi_leaky_update_voltage().
void aspi_leaky_set_max_delay | ( | aspi_object_t * | self, | |
int | delay | |||
) |
Set max delay of a neuron.
Alloc the necessary memory
Shouldn't be used while net is running
References ASPI_LEAKY, aspi_return_if_fail, aspi_leaky_t::futur_voltages_exci, aspi_leaky_t::futur_voltages_inhib, and aspi_leaky_t::max_delay.
Referenced by aspi_leaky_dup(), and aspi_leaky_init_full().
void aspi_leaky_set_memory | ( | aspi_object_t * | self, | |
int | memory | |||
) |
Set memory of the neuron.
Alloc the necessary memory for the buffer
You shouldn't use this method while net is runinng
References ASPI_LEAKY, aspi_return_if_fail, aspi_leaky_t::last_spike, aspi_leaky_t::memory, and aspi_leaky_t::v_traces.
Referenced by aspi_leaky_dup(), aspi_leaky_init(), and aspi_leaky_init_full().
void aspi_leaky_set_threshold | ( | aspi_object_t * | self, | |
double | threshold | |||
) |
Set a neuron's threshold
If this function is not called individually (except in the init func), then threshold is the default one.
References ASPI_LEAKY, and aspi_leaky_t::threshold.
void aspi_leaky_update_voltage | ( | aspi_object_t * | self | ) |
Update the voltages of a neuron, ie, add the voltages it got in precedent steps
Of course, this method is used by the model's method, but the network must still uptade all neuron's voltage.
This method also "reset" the spike if neuron has fired
It also handles the v_trace.
References ASPI_LEAKY, aspi_leaky_get_last_spike(), aspi_leaky_get_threshold_ip(), aspi_leaky_set_last_spike(), aspi_misc_random_gaussian(), ASPI_NETWORK, ASPI_NEURON, aspi_neuron_add_to_v(), aspi_neuron_get_v(), aspi_neuron_set_v(), aspi_leaky_t::freq, aspi_leaky_t::futur_voltages_exci, aspi_leaky_t::futur_voltages_inhib, aspi_leaky_t::max_delay, aspi_leaky_t::memory, aspi_leaky_t::network, aspi_leaky_t::threshold, aspi_leaky_t::v_mem, aspi_leaky_t::v_traces, and aspi_leaky_t::vindex.
void aspi_neuron_class_set_reversal_potential | ( | int | set_reversal_potential | ) |
Set reversal potential
If it is set, a neuron will receive I = I (v - v_r) instead of I.
V_r being different for excitation (rev_pot_exci) and inhibition (rev_pot_inhib).
Those must be set with aspi_leaky_class_set_reversal_potentials (mind the s)
void aspi_neuron_class_set_reversal_potentials | ( | double | rev_pot_exci, | |
double | rev_pot_inhib | |||
) |
Set reversal potentials
If set_reversal_potential is set, a neuron will receive I = I (v - v_r) instead of I.
V_r being different for excitation (rev_pot_exci) and inhibition (rev_pot_inhib).