colored-CARL-Logo

 


CARLsim Documentation:
Class CpuSNN

NOTE:
This page is currently under construction.

Following all public methods of Class CpuSNN. For a list of other classes see Documentation.

^Public properties

const unsigned int MAJOR_VERSION: major version number of the code release
const unsigned int MINOR_VERSION: minor version number of the code release

^CpuSNN::connect

int connect(int grpId1, int grpId2, const string& _type, float initWt,
            float maxWt, float p, uint8_t minDelay, uint8_t maxDelay,
            bool synWtType=SYN_FIXED, const string& wtType=" ")

Creates synaptic projections from a pre-synaptic group to a post-synaptic group using a pre-defined primitive type. For a practical example, see Section connect in the Tutorial.
Input arguments:

int grpId1: ID of the pre-synaptic group
int grpId2: ID of the post-synaptic group
const string& _type: connection type. "random": random connectivity. "one-to-one": connect the i-th neuron in pre to the i-th neuron in post. "full": connect all neurons in pre to all neurons in post (no self-connections).
float initWt: initial weight strength (arbitrary units); should be negative for inhibitory connections
float maxWt: upper bound on weight strength (arbitrary units); should be negative for inhibitory connections
float p: connection probability
uint8_t minDelay: the minimum delay allowed (ms)
uint8_t maxdelay: the maximum delay allowed (ms)
bool synWtType: (optional) connection type, either SYN_FIXED or SYN_PLASTIC. Default: SYN_FIXED.
const string& wtType: (optional)
DEPRECATED

Output arguments:

int: number of created synaptic projections
int connect(int grpId1, int grpId2, ConnectionGenerator* conn,
            bool synWtType=SYN_FIXED, int maxM=0, int maxPreM=0)

Creates synaptic projections using a callback mechanism. For a practical example see Section connect in the Tutorial.
Input arguments:

int grpId1: ID of the pre-synaptic group
int grpId2: ID of the post-synaptic group
ConnectionGenerator* conn: pointer to an instance of class ConnectionGenerator
bool synWtType: (optional) connection type, either SYN_FIXED or SYN_PLASTIC. Default: SYN_FIXED.
int maxM: (optional) maximum number of post-synaptic connections (per neuron). Set to 0 for no limit. Default: 0.
int maxPreM: (optional) maximum number of pre-synaptic connections (per neuron). Set to 0 for no limit. Default: 0.

Output arguments:

int: number of created synaptic projections

^CpuSNN::CpuSNN

CpuSNN(const string& _name, int _numConfig = 1, int randomize = 0,
       int mode=CPU_MODE)

Class constructor.
Input arguments:

const string& _name: network name
int _numConfig: (optional) number of configurations. Default: 1.
DEPRECATED

int randomize: (optional) seed for the random number generator. Default: 0
int mode: (optional) simulation mode, either CPU_MODE or GPU_MODE. Default: CPU_MODE. See also Section CPU vs. GPU simulation modes in the Tutorial.

^CpuSNN::~CpuSNN

~CpuSNN()

Destructor.

NOTE:
In general, the destructor should not be called directly.

^CpuSNN::createGroup

int createGroup(const string& _name, unsigned int _numN, int _nType)

Creates a group of Izhikevich spiking neurons.
Input arguments:

const string& _name: string name for the group (need not be unique)
unsigned int _numN: number of neurons in the group
int _nType: neuron type, either EXCITATORY_NEURON or INHIBITORY_NEURON

NOTE:
See also CpuSNN::createSpikeGeneratorGroup.

^CpuSNN::createSpikeGeneratorGroup
CARLsim ≥ 2.0

int createSpikeGeneratorGroup(const string& _name, int unsigned size_n, int stype)

Creates a spike generator group (dummy-neurons, not Izhikevich spiking neurons).
Input arguments:

const string& _name: string name for the group (need not be unique)
unsigned int size_n: number of neurons in the group
int stype: spike generator type, currently only supports EXCITATORY_NEURON

NOTE:
See also CpuSNN::createGroup.

^CpuSNN::getDelays
CARLsim ≥ 2.0

uint8_t* getDelays(int gIDpre, int gIDpost, int& Npre, int& Npost,
		     uint8_t* delays=NULL)

Returns the delay information for all synaptic connections between a pre-synaptic and a post-synaptic neuron group
Input arguments:

int gIDpre: ID of pre-synaptic group
int gIDpost: ID of post-synaptic group
int& Npre: will contain the number of pre-synaptic neurons
int& Npost: will contain the number of post-synaptic neurons
uint8_t* delays: (optional) will contain the delay information for all synapses (same as output argument)

Output arguments:

uint8_t*: same as optional argument above: delay information for all synapses

^CpuSNN::getWeightChanges
CARLsim ≥ 2.0

float* getWeightChanges(int gIDpre, int gIDpost, int& Npre, int& Npost,
			    float* weightChanges=NULL)

Returns the change in weight strength in the last second (due to plasticity) for all synaptic connections between a pre-synaptic and a post-synaptic neuron group.
Input arguments:

int gIDpre: ID of pre-synaptic group
int gIDpost: ID of post-synaptic group
int& Npre: will contain the number of pre-synaptic neurons
int& Npost: will contain the number of post-synaptic neurons
float* weightChanges: (optional) will contain the weight changes for all synapses (same as output argument)

Output arguments:

float*: same as optional argument above: weight changes for all synapses

NOTE:
See also CpuSNN::getWeights.

^CpuSNN::getWeights
CARLsim ≥ 2.0

float* getWeights(int gIDpre, int gIDpost, int& Npre, int& Npost,
		    float* weights=NULL)

Returns the weight strengths for all synaptic connections between a pre-synaptic and a post-synaptic neuron group.
Input arguments:

int gIDpre: ID of pre-synaptic group
int gIDpost: ID of post-synaptic group
int& Npre: will contain the number of pre-synaptic neurons
int& Npost: will contain the number of post-synaptic neurons
float* weightChanges: (optional) will contain the weight strengths for all synapses (same as output argument)

Output arguments:

float*: same as optional argument above: weight strengths for all synapses

NOTE:
See also CpuSNN::getWeightChanges.

^CpuSNN::printDotty

Creates a graphical representation of the network topology and stores it in a dotty file (where the file name corresponds to the network name _name specified in CpuSNN::CpuSNN.

NOTE:
In order to open file, GraphViz must be installed.

^CpuSNN::printMemoryInfo

void printMemoryInfo(FILE* fp=stdout)

Prints memory information to file.
Input arguments:

FILE* fp: (optional) file pointer. Default: stdout

^CpuSNN::printSimSummary

void printSimSummary(FILE *fp = stdout)

Prints a simulation summary to file.
Input arguments:

FILE* fp: (optional) file pointer. Default: stdout

^CpuSNN::readNetwork
CARLsim ≥ 2.0

void readNetwork(FILE* fid)

Reads a CARLsim network file. Such a file can be created using CpuSNN:writeNetwork. For a practical example see Section Storing and retrieving the network state in the Tutorial.
Input arguments:

FILE* fp: file pointer

NOTE:
After calling CpuSNN::readNetwork, you should run CpuSNN::runNetwork before calling fclose(fid);.
NOTE:
See also CpuSNN::writeNetwork.

^CpuSNN::runNetwork

int runNetwork(int _nsec, int _nmsec = 0, int simType = CPU_MODE, int ithGPU = 0,
               bool enablePrint=false, int copyState=false)

Runs a simulation. First, network must be correctly specified and instantiated (see Tutorial).
Input arguments:

int _nsec: number of seconds to run
int _nmsec: (optional) number of milliseconds to run. Default: 0
int simType: (optional) on which architecture to run the network, either CPU_MODE or GPU_MODE. Default: CPU_MODE
int ithGPU: (optional) on which CUDA device to run (0-indexed). If index is invalid (e.g., exceeds the number of available cards), it will default to 0. Default: 0
bool enablePrint: (optional) enables the printing of essential neuronal information (such as current membrane potential, recovery variable, synaptic conductances, etc.). Default: false. bool copyState: (optional) enables the copying of essential neuronal information (see above) from the GPU if run in GPU mode. Default: false.
Output arguments:
int: TODO why would it return anything?

^CpuSNN::setConductances
CARLsim ≥ 2.0

void setConductances(int grpId, bool enable, float tAMPA, float tNMDA,
          float tGABAa, float tGABAb, int configId)

Sets the decay time constants for synaptic conductances of a neuron group. To disable the use of synaptic conductanes for a group, you can also use a simple wrapper: void setConductances(int grpId, bool enable). To apply conductance values to all groups, replace grpId with ALL.
Synaptic channels are modeled with instantaneous rise-time and exponential decay. For details on the ODE that is implemented refer to (Izhikevich et al, 2004), and for suitable values see (Dayan & Abbott, 2001).
Input arguments:

int grpId: ID of the neuron group
bool enable: enables the use of COBA mode
float tAMPA: time constant of AMPA decay (ms); for example, 5.0
float tNMDA: time constant of NMDA decay (ms); for example, 150.0
float tGABAa: time constant of GABAa decay (ms); for example, 6.0
float tGABAb: time constant of GABAb decay (ms); for example, 150.0
int configId: configuration number
DEPRECATED

^CpuSNN::setLogCycle

void setLogCycle(unsigned int _cnt, int mode=0, FILE *fp=NULL)

Sets the update cycle for log messages.
Input arguments:

unsigned int _cnt: to disable logging, set to 0
int mode: (optional) the higher this number, the more logging information will be printed. Default: 0
FILE* fp: (optional) file pointer for log info. Default: NULL

^CpuSNN::setNeuronParameters

void setNeuronParameters(int groupId, float _a, float _b, float _c,
			    float _d)

Sets the Izhikevich parameters a, b, c, and d of a neuron group. See (Izhikevich, 2003) for a description of the neuron model; see (Izhikevich, 2004) for meaningful choices of parameter values.
Input arguments:

int groupId: ID of the neuron group
float _a, _b, _c, _d: Izhikevich parameters a, b, c, and d


void setNeuronParameters(int groupId, float _a, float a_sd, float _b,
			    float b_sd, float _c, float c_sd, float _d,
			    float d_sd);

Sets the Izhikevich parameters a, b, c, and d of a neuron group. Parameter values for each neuron are given by a normal distribution with mean _a, _b, _c, _d standard deviation a_sd, b_sd, c_sd, and d_sd, respectively.
Input arguments:

int groupId: ID of the neuron group
float _a, _b, _c, _d: mean value for Izhikevich parameters a, b, c, and d
float a_sd, b_sd, c_sd, d_sd: standard deviation for Izhikevich parameters a, b, c, and d

^CpuSNN::setSpikeGenerator
CARLsim ≥ 2.0

void setSpikeGenerator(int grpId, SpikeGenerator* spikeGen, int configId=ALL)

Sets a spike generator. For information on spike generators, see Section Spike injection generators in the Tutorial.
Input arguments:

int grpId: ID of the neuron group
SpikeGenerator* spikeGen: pointer to an instance of class SpikeGenerator
configId:
DEPRECATED

^CpuSNN::setSpikeMonitor
CARLsim ≥ 2.0

void setSpikeMonitor(int gid, const string& fname, int configId=0)

Sets a spike monitor. For information on spike monitors, see Section Interacting with the simulation in the Tutorial.
Input arguments:

int gid: ID of the neuron group
const string& fname: (optional) file name where to output spikes. Leave empty to just print to stdout
configId:
DEPRECATED

^CpuSNN::setSpikeRate
CARLsim ≥ 2.0

void setSpikeRate(int grpId, PoissonRate* spikeRate, int refPeriod=1,
                  int configId=ALL)

Sets the Poisson spike rate for a group. For information on how to set up spikeRate, see Section Poisson spike generators in the Tutorial.
Input arguments:

int grpId: ID of the neuron group
PoissonRate* spikeRate: pointer to a spike rate instance
int refPeriod: (optional) refractive period. Default: 1
int configId:
DEPRECATED

^CpuSNN::setSTDP
CARLsim ≥ 2.0

void setSTDP(int grpId, bool enable, float _ALPHA_LTP, float _TAU_LTP,
             float _ALPHA_LTD, float _TAU_LTD, int configId=ALL)

Sets the spike-timing-dependent plasticity (STDP) for a neuron group. STDP must be defined post-synaptically; that is, if STP should be implemented on the connections from group 0 to group 1, call setSTP on group 1.
Fore details on the phenomeon, see (for example) (Bi & Poo, 2001).
Input arguments:

int grpId: ID of the neuron group
bool enable: set to true to enable STDP for this group
float _ALPHA_LTP: max magnitude for LTP change
float _TAU_LTP: decay time constant for LTP
float _ALPHA_LTD: max magnitude for LTD change (leave positive)
float _TAU_LTD: decay time constant for LTD int configId:
DEPRECATED

^CpuSNN::setSTP
CARLsim ≥ 2.0

void setSTP(int g, bool enable, float STP_U, float STP_tD, float STP_tF,
            int configId=ALL)

Sets the short-term plasticity (STP) for a neuron group. STP must be defined pre-synaptically; that is, if STP should be implemented on the connections from group 0 to group 1, call setSTP on group 0.
For details on the phenomenon, see (for example) (Markram et al, 1998), (Mongillo et al, 2008).
Input arguments:

int g: ID of the neuron group
bool enable: set to true to enable STP for this group
float STP_U: the increment of u due to a spike
float STP_tD: time constant for depression term
float STP_tF: time constant for faciliation term
int configId:
DEPRECATED

^CpuSNN::writeNetwork
CARLsim ≥ 2.0

void writeNetwork(FILE* fid)

Writes the network state to file. The network state includes all neuron IDs, synapse IDs, their corresponding weights and delays. The file created with this function can be read either with CpuSNN::readNetwork to be re-used in another simulation, or by the Matlab script common:readNetwork for visualization or further analysis.
Input arguments:

FILE* fid: file pointer, where to store the network state

NOTE:
See also CpuSNN::readNetwork and Matlab script common:readNetwork.

^References

  • Bi, G., and M. Poo. 2001. "Synaptic modification by correlated activity: Hebb's postulate revisited." Annu Rev Neurosci no. 24:139-66. doi: 10.1146/annurev.neuro.24.1.139.
  • Dayan, Peter, and L. F. Abbott. 2001. Theoretical neuroscience : computational and mathematical modeling of neural systems, Computational neuroscience. Cambridge, Mass.: Massachusetts Institute of Technology Press.
  • Izhikevich, E. M. 2003. "Simple model of spiking neurons." Ieee Transactions on Neural Networks no. 14 (6):1569-1572. doi: Doi 10.1109/Tnn.2003.820440.
  • Izhikevich, E. M. 2004. "Which model to use for cortical spiking neurons?" Ieee Transactions on Neural Networks no. 15 (5):1063-1070. doi: Doi 10.1109/Tnn.2004.832719
  • Izhikevich, E. M., J. A. Gally, and G. M. Edelman. 2004. "Spike-timing dynamics of neuronal groups." Cerebral Cortex no. 14 (8):933-944. doi: DOI 10.1093/cercor/bhh053.
  • Markram, H., Y. Wang, and M. Tsodyks. 1998. "Differential signaling via the same axon of neocortical pyramidal neurons." Proceedings of the National Academy of Sciences of the United States of America no. 95 (9):5323-5328. doi: DOI 10.1073/pnas.95.9.5323.
  • Mongillo, G., O. Barak, and M. Tsodyks. 2008. "Synaptic theory of working memory." Science no. 319 (5869):1543-6. doi: 10.1126/science.1150769.
 
 
 

 

CARLsim

Carl