Class to encapsulate the behavior of a single theta neuron. More...
#include <thetaNeuron.h>
Public Types | |
enum | Method { Numerical, EventDriven } |
Public Member Functions | |
thetaNeuron (int new_num_inputs=3.0, double weight_ini=1e6, double new_io=IO) | |
~thetaNeuron () | |
double | getPhase (void) |
Method | getMethod (void) |
void | setMethod (Method new_method) |
void | setVerbose (bool new_verbose) |
double | getWeight (int index) |
void | setWeight (double new_weight, int index) |
double | getIo (void) |
void | setIo (double new_io) |
void | displayThetaNeuron (void) |
int | runThetaNeuron (double ti[], double ts[], int max_num_ts) |
Class to encapsulate the behavior of a single theta neuron.
This class, in addition to setting, getting and displaying neuron properties, includes functionality to simulate a Theta Neuron. There are two simulation methods (methods by which to observe the timing of output spikes which result from the interaction of the neuron dynamic properties and input spikes) available, Numerical and EventDriven. These methods produce nearly identical results, however EventDriven is more efficient, while Numerical is included for clarity and comparison. There will be at most one output spike after the last input spike, depending on the neuron phase and the baseline current.
Definition at line 57 of file thetaNeuron.h.
enum thetaNeuron::Method |
Simulation Method Enum.
This Enumeration contains the two possible methods used for simulating theta neurons in this implementation, Numerical and EventDriven.
Definition at line 69 of file thetaNeuron.h.
thetaNeuron::thetaNeuron | ( | int | new_num_inputs = 3.0 , |
|
double | weight_ini = 1e6 , |
|||
double | new_io = IO | |||
) | [inline] |
Theta Neuron Constructor.
The theta neuron constructor takes three inputs, the number of neuron inputs, the initial weight and the baseline current.
In this implementation, new_io must be negative, with typical values of -0.0001 < io < -0.1. If an attempt is made to assign io to a non-negative value or if io is not assigned at all, then io reverts to the default value of -0.001.
If weight_ini is not specified or if it is specified as > 100, then the weights are randomized with a uniform distribution between -1 and 1.
If new_num_inputs is not specified, then the default value of 3 input neurons is used.
Other neuron properties are also assigned here and may be subsequently change using the get/set functions. Specifically, verbose is set to 1 meaning additional information will be displayed to the console during simulation, and method is set to Numerical, meaning numerical intergation will be used by default in the simulation.
new_num_inputs | The number of input neurons desired. | |
weight_ini | The value to initialize all weights to. | |
new_io | The baseline current. |
Definition at line 96 of file thetaNeuron.h.
thetaNeuron::~thetaNeuron | ( | ) | [inline] |
Theta Neuron Destructor.
The Destructor simply deallocates the memory used for the neuron weights.
Definition at line 120 of file thetaNeuron.h.
void thetaNeuron::displayThetaNeuron | ( | void | ) |
Public Method to Display Theta Neuron Properties
Definition at line 11 of file thetaNeuron.cpp.
double thetaNeuron::getIo | ( | void | ) | [inline] |
Public Method to Get the Baseline Current, Io
Definition at line 196 of file thetaNeuron.h.
Method thetaNeuron::getMethod | ( | void | ) | [inline] |
Public Method to Get the Neuron Simulation Method
Definition at line 142 of file thetaNeuron.h.
double thetaNeuron::getPhase | ( | void | ) | [inline] |
Public Method to Get the Neuron Phase (State)
Definition at line 134 of file thetaNeuron.h.
double thetaNeuron::getWeight | ( | int | index | ) | [inline] |
Public Method to Get the Weight at input neuron index
index | Index into the neuron's inputs from which to get the weight value; must not be greater than the number of inputs or -1 will be returned |
Definition at line 169 of file thetaNeuron.h.
int thetaNeuron::runThetaNeuron | ( | double | ti[], | |
double | ts[], | |||
int | max_num_ts = MAX_NUM_OUTPUT_SPIKES | |||
) |
Public Method to Find Output Spike Times, ts, of a maximum length max_num_ts, with input spike times in array ti
ti | an array of input spike times. | |
ts | an array that will be filled in with output spike times. | |
max_num_ts | the maximum number of output spikes that will be returned. |
Definition at line 25 of file thetaNeuron.cpp.
void thetaNeuron::setIo | ( | double | new_io | ) | [inline] |
Public Method to Set the Baseline Current, Io
new_io | New baseline current value, must be negative or baseline current will not be set |
Definition at line 205 of file thetaNeuron.h.
void thetaNeuron::setMethod | ( | Method | new_method | ) | [inline] |
Public Method to Set the Neuron Simulation Method
new_method | An enumerator of type Method representing the new simulation method |
Definition at line 151 of file thetaNeuron.h.
void thetaNeuron::setVerbose | ( | bool | new_verbose | ) | [inline] |
Public Method to Set the Verbosity of the Theta Neuron Simulation
new_verbose | A boolean flag representing whether verbose comments should be printed to the console window during simulation |
Definition at line 160 of file thetaNeuron.h.
void thetaNeuron::setWeight | ( | double | new_weight, | |
int | index | |||
) | [inline] |
Public Method to Set the Weight at input neuron index to new_weight
new_weight | New weight value | |
index | Index into neuron's inputs at which to set the new weight; must not be greater than the number of inputs or weight will not be set |
Definition at line 184 of file thetaNeuron.h.