Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
Public Member Functions | Public Attributes | Protected Attributes | List of all members
auryn::CorrelatedPoissonGroup Class Reference

A PoissonGroup with multiple subpopulations that co-modulate their firing rate according to an Ornstein Uhlenbeck process. More...

#include <CorrelatedPoissonGroup.h>

Inheritance diagram for auryn::CorrelatedPoissonGroup:
Inheritance graph
[legend]
Collaboration diagram for auryn::CorrelatedPoissonGroup:
Collaboration graph
[legend]

Public Member Functions

 CorrelatedPoissonGroup (NeuronID n, AurynDouble rate=5., NeuronID gsize=100, AurynDouble timedelay=50e-3)
 
virtual ~CorrelatedPoissonGroup ()
 
virtual void evolve ()
 Virtual pure evolve function which needs to be implemented by derived classes. More...
 
void set_rate (AurynDouble rate)
 
void set_amplitude (AurynDouble ampl)
 
void set_target_amplitude (AurynDouble ampl)
 
void set_tau_amplitude (AurynDouble scale)
 
void set_timescale (AurynDouble scale)
 
void set_offset (int off)
 
void set_threshold (AurynDouble threshold)
 
void set_stoptime (AurynDouble stoptime)
 
AurynDouble get_rate ()
 
void seed ()
 
- Public Member Functions inherited from auryn::SpikingGroup
void add_state_vector (std::string key, AurynStateVector *state_vector)
 Adds a state vector passed as an argument to the dictinary. More...
 
void remove_state_vector (std::string key)
 Removes a state vector passed as an argument to the dictinary. More...
 
AurynStateVectorfind_state_vector (std::string key)
 Returns existing state vector by name or NULL if it does not exist. More...
 
AurynStateVectorget_state_vector (std::string key)
 Creates a new or returns an existing state vector by name. More...
 
AurynStateVectorget_existing_state_vector (std::string key)
 Returns an existing state with the supplied name. More...
 
AurynStateVectorcreate_state_vector (std::string key)
 Creates a new state vector and throws an exception if a vector with the same name exists. More...
 
AurynStateget_state_variable (std::string key)
 Creates a new group-wide state variable or returns an existing group-wide variable by name then returns a pointer to it. More...
 
void randomize_state_vector_gauss (std::string state_vector_name, AurynState mean, AurynState sigma, int seed=12239)
 Randomizes the content of a state vector with Gaussian random numbers. Seeding is MPI save. More...
 
 SpikingGroup (NeuronID size, NodeDistributionMode mode=AUTO)
 Default constructor. More...
 
virtual ~SpikingGroup ()
 Default destructor. More...
 
virtual void evolve_traces ()
 Evolves traces. More...
 
void set_name (std::string s)
 Set connection name. More...
 
std::string get_name ()
 Retrieves the groups name. More...
 
std::string get_file_name ()
 Extracts the class name of the connection from the file name. More...
 
std::string get_log_name ()
 Returns a string which is the combination of file and connection name for logging. More...
 
void inc_num_spike_attributes (int x)
 Instructs SpikingGroup to increase the number of spike attributes by x. More...
 
int get_num_spike_attributes ()
 
void conditional_evolve ()
 Conditional evolve functino which is called by System. More...
 
unsigned int get_locked_rank ()
 Returns locked rank for SpikingGroups which are not distributed across all ranks. More...
 
unsigned int get_locked_range ()
 Returns locked range of ranks for SpikingGroups which are not distributed across all ranks. More...
 
SpikeContainerget_spikes ()
 Returns pointer to a spike container that contains spikes which arrive in this timestep from all neurons in this group. More...
 
SpikeContainerget_spikes_immediate ()
 Returns pointer to SpikeContainer of spikes generated during the last evolve() step. More...
 
AttributeContainerget_attributes ()
 Returns pointer to Attributecontainer for usage in propagating Connection objects. Same as get_spikes_immediate(), however might be overwritten to contain Spikes that have been delayed. More...
 
AttributeContainerget_attributes_immediate ()
 Returns pointer to Attributecontainer of spikes generated during the last evolve() step. More...
 
NeuronID get_size ()
 Returns the size of the group. More...
 
NeuronID get_pre_size ()
 Returns the size of the group. More...
 
NeuronID calculate_rank_size (int rank=-1)
 Determines rank size and stores it in local variable. More...
 
NeuronID get_rank_size ()
 Returns the size on this rank. More...
 
NeuronID get_post_size ()
 Returns the size on this rank. More...
 
void set_clock_ptr (AurynTime *clock)
 
bool evolve_locally ()
 Returns true if the calling instance has units which are integrated on the current rank. More...
 
NeuronID get_uid ()
 Get the unique ID of the class. More...
 
Traceget_pre_trace (AurynFloat x)
 Returns a pre trace with time constant x. More...
 
void add_pre_trace (Trace *tr)
 Adds trace to pretrace stack of a connection. More...
 
Traceget_post_trace (AurynFloat x)
 Returns a post trace with time constant x. More...
 
void add_post_trace (Trace *tr)
 Adds trace to posttrace stack of a connection. More...
 
void push_spike (NeuronID spike)
 Pushes a local NeuronID as spike into the axonal SpikeDelay buffer. More...
 
void push_attribute (AurynFloat attrib)
 Pushes a spike attribute into the axonal SpikeDelay buffer. More...
 
void clear_spikes ()
 Clears all spikes stored in the delays which is useful to reset a network during runtime. More...
 
Traceget_post_state_trace (std::string state_name="mem", AurynFloat tau=10e-3, AurynFloat b=0.0)
 Returns a post trace of a neuronal state variable e.g. the membrane potential with time constant tau. More...
 
Traceget_post_state_trace (AurynStateVector *state, AurynFloat tau=10e-3, AurynFloat b=0.0)
 Returns a post trace of a neuronal state variable specified by pointer. More...
 
void set_delay (int d)
 Sets axonal delay for this SpikingGroup. More...
 
virtual bool write_to_file (const char *filename)
 Writes current states of SpikingGroup to human-readible textfile if implemented in derived class. More...
 
virtual bool load_from_file (const char *filename)
 Reads current states of SpikingGroup to human-readible textfile if implemented in derived class. More...
 
NeuronID ranksize ()
 Returns size (num of neurons) on the current rank. More...
 
NeuronID global2rank (NeuronID i)
 Converts global NeuronID within the SpikingGroup to the local NeuronID on this rank. More...
 
NeuronID rank2global (NeuronID i)
 Converts local NeuronID from the local rank to a global NeuronID. More...
 
bool localrank (NeuronID i)
 Checks if the global NeuronID i is integrated on this MPI rank. More...
 
NeuronID get_vector_size ()
 Rank size but rounded up to multiples of 4 (or potentially some other and larger number in future versions) for SSE compatibility. More...
 

Public Attributes

AurynDouble mean
 
- Public Attributes inherited from auryn::SpikingGroup
SpikeDelaydelay
 
bool active
 Toggles group active. More...
 
std::map< std::string, AurynStateVector * > state_vectors
 
std::map< std::string, AurynStatestate_variables
 

Protected Attributes

AurynDouble lambda
 
AurynTime tstop
 
NeuronID groupsize
 
NeuronID remainersize
 
NeuronID ngroups
 
AurynDouble timescale
 
int offset
 
AurynTime delay
 
AurynDouble o
 
AurynDoubledelay_o
 
AurynDouble amplitude
 
AurynDouble tau_amplitude
 
AurynDouble target_amplitude
 
AurynDouble thr
 
NeuronIDx
 
- Protected Attributes inherited from auryn::SpikingGroup
std::vector< Trace * > pretraces
 Pretraces. More...
 
std::vector< Trace * > posttraces
 Posttraces. More...
 
std::vector< Trace * > post_state_traces
 Post state traces. More...
 
std::vector< AurynFloatpost_state_traces_spike_biases
 
std::vector< AurynStateVector * > post_state_traces_states
 
std::string group_name
 Identifying name for object. More...
 
NeuronID size
 Stores the size of the group. More...
 
NeuronID rank_size
 Stores the size of the group on this rank. More...
 
SpikeContainerspikes
 SpikeContainers to store spikes produced during one step of evolve. More...
 
AttributeContainerattribs
 

Additional Inherited Members

- Protected Member Functions inherited from auryn::SpikingGroup
virtual void load_input_line (NeuronID i, const char *buf)
 
virtual std::string get_output_line (NeuronID i)
 
virtual void virtual_serialize (boost::archive::binary_oarchive &ar, const unsigned int version)
 Implementatinon of serialize function for writing. More...
 
virtual void virtual_serialize (boost::archive::binary_iarchive &ar, const unsigned int version)
 Implementatinon of serialize function for reading. More...
 
void free ()
 Frees potentially allocated memory. More...
 
- Static Protected Attributes inherited from auryn::SpikingGroup
static AurynTimeclock_ptr = NULL
 

Detailed Description

A PoissonGroup with multiple subpopulations that co-modulate their firing rate according to an Ornstein Uhlenbeck process.

The group can be used to provide a stimulus for Hebbian learning in networks. When defined a given number of groups of given size are defined, as well as a correlation time.

Constructor & Destructor Documentation

◆ CorrelatedPoissonGroup()

CorrelatedPoissonGroup::CorrelatedPoissonGroup ( NeuronID  n,
AurynDouble  rate = 5.,
NeuronID  gsize = 100,
AurynDouble  timedelay = 50e-3 
)

Default constructor.

Parameters
nthe size of the group which will be devided by the size of one subgroup to give the number of groups.
ratethe mean firing rate of all cells.
gsizethe size of one subgroup.
timedelaydelay between groups.
91  : SpikingGroup( n )
92 {
93  init(rate, gsize, timedelay);
94 }
SpikingGroup(NeuronID size, NodeDistributionMode mode=AUTO)
Default constructor.
Definition: SpikingGroup.cpp:38
int n
Definition: mkpat.py:5

◆ ~CorrelatedPoissonGroup()

CorrelatedPoissonGroup::~CorrelatedPoissonGroup ( )
virtual
97 {
98  if ( evolve_locally() ) {
99  delete dist;
100  delete shared_noise;
101  delete rank_noise;
102  delete delay_o;
103  }
104 }
AurynDouble * delay_o
Definition: CorrelatedPoissonGroup.h:76
bool evolve_locally()
Returns true if the calling instance has units which are integrated on the current rank...
Definition: SpikingGroup.cpp:323
Here is the call graph for this function:

Member Function Documentation

◆ evolve()

void CorrelatedPoissonGroup::evolve ( )
virtual

Virtual pure evolve function which needs to be implemented by derived classes.

The evolve function is called during simulations in every timestep by the System class. It updates the internal state of the spiking group and pushes spikes which are generated in this timestep to the axonal output delay (SpikeDelay).

Implements auryn::SpikingGroup.

123 {
124  // check if the group has timed out
125  if ( tstop && auryn::sys->get_clock() > tstop ) return;
126 
127  // move amplitude
129 
130  // integrate Ornstein Uhlenbeck process
131  o += ( mean - o )*auryn_timestep/timescale;
132 
133  // noise increment
134  o += 2.0*((AurynDouble)(*shared_noise)()-0.5)*sqrt(auryn_timestep/timescale)*amplitude;
135 
136 
137  // if ( sys->get_clock() % 10000 == 0 ) {
138  // std::cout << sys->mpi_rank() << " " << o << std::endl;
139  // }
140 
141  int len = delay*ngroups;
142  delay_o[auryn::sys->get_clock()%len] = std::max(thr,o*lambda);
143 
144  for ( unsigned int g = 0 ; g < ngroups ; ++g ) {
145  AurynDouble grouprate = delay_o[(auryn::sys->get_clock()-(g+offset)*delay)%len];
146  AurynDouble r = (*rank_noise)()/(auryn_timestep*grouprate); // think before tempering with this!
147  // I already broke the corde here once!
148  x[g] = (NeuronID)(r);
149  while ( x[g] < groupsize ) {
150  push_spike ( g*groupsize + x[g] );
151  r = (*rank_noise)()/(auryn_timestep*grouprate);
152  x[g] += (NeuronID)(r);
153  }
154  }
155 }
int offset
Definition: CorrelatedPoissonGroup.h:71
r
Definition: mkpat.py:9
NeuronID groupsize
Definition: CorrelatedPoissonGroup.h:66
AurynDouble thr
Definition: CorrelatedPoissonGroup.h:82
AurynDouble tau_amplitude
Definition: CorrelatedPoissonGroup.h:80
AurynDouble mean
Definition: CorrelatedPoissonGroup.h:88
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
AurynDouble target_amplitude
Definition: CorrelatedPoissonGroup.h:81
AurynTime tstop
Definition: CorrelatedPoissonGroup.h:64
AurynDouble * delay_o
Definition: CorrelatedPoissonGroup.h:76
AurynTime delay
Definition: CorrelatedPoissonGroup.h:72
AurynDouble o
Definition: CorrelatedPoissonGroup.h:75
double auryn_timestep
Simulation timestep in seconds.
Definition: auryn_definitions.cpp:31
System * sys
Global pointer to instance of System which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:37
AurynDouble lambda
Definition: CorrelatedPoissonGroup.h:62
void push_spike(NeuronID spike)
Pushes a local NeuronID as spike into the axonal SpikeDelay buffer.
Definition: SpikingGroup.cpp:270
NeuronID ngroups
Definition: CorrelatedPoissonGroup.h:68
NeuronID * x
Definition: CorrelatedPoissonGroup.h:85
AurynTime get_clock()
Gets the current clock value in AurynTime.
Definition: System.cpp:231
AurynDouble amplitude
Definition: CorrelatedPoissonGroup.h:79
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
AurynDouble timescale
Definition: CorrelatedPoissonGroup.h:70
Here is the call graph for this function:

◆ get_rate()

AurynDouble CorrelatedPoissonGroup::get_rate ( )
117 {
118  return lambda;
119 }
AurynDouble lambda
Definition: CorrelatedPoissonGroup.h:62

◆ seed()

void CorrelatedPoissonGroup::seed ( )
158 {
159  shared_noise_gen.seed(sys->get_synced_seed());
160  rank_noise_gen.seed(sys->get_seed());
161 }
unsigned int get_seed()
Returns a random seed which is different on each rank.
Definition: System.cpp:1030
System * sys
Global pointer to instance of System which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:37
unsigned int get_synced_seed()
Returns a random seed which is the same on each rank.
Definition: System.cpp:1035
Here is the call graph for this function:

◆ set_amplitude()

void CorrelatedPoissonGroup::set_amplitude ( AurynDouble  ampl)
164 {
165  amplitude = amp;
166  auryn::logger->parameter("amplitude",amplitude);
167 }
void parameter(std::string name, T value)
Definition: Logger.h:90
Logger * logger
Global pointer to instance of Logger which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:36
AurynDouble amplitude
Definition: CorrelatedPoissonGroup.h:79
Here is the call graph for this function:

◆ set_offset()

void CorrelatedPoissonGroup::set_offset ( int  off)
188 {
189  offset = off;
190  auryn::logger->parameter("offset",offset);
191 }
int offset
Definition: CorrelatedPoissonGroup.h:71
void parameter(std::string name, T value)
Definition: Logger.h:90
Logger * logger
Global pointer to instance of Logger which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:36
Here is the call graph for this function:

◆ set_rate()

void CorrelatedPoissonGroup::set_rate ( AurynDouble  rate)
107 {
108  lambda = rate;
109 }
AurynDouble lambda
Definition: CorrelatedPoissonGroup.h:62

◆ set_stoptime()

void CorrelatedPoissonGroup::set_stoptime ( AurynDouble  stoptime)
194 {
195  tstop = stoptime*auryn_timestep;
196  auryn::logger->parameter("stoptime",stoptime);
197 }
void parameter(std::string name, T value)
Definition: Logger.h:90
AurynTime tstop
Definition: CorrelatedPoissonGroup.h:64
Logger * logger
Global pointer to instance of Logger which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:36
double auryn_timestep
Simulation timestep in seconds.
Definition: auryn_definitions.cpp:31
Here is the call graph for this function:

◆ set_target_amplitude()

void CorrelatedPoissonGroup::set_target_amplitude ( AurynDouble  ampl)
170 {
171  target_amplitude = amp;
172  auryn::logger->parameter("target_amplitude",target_amplitude);
173 }
void parameter(std::string name, T value)
Definition: Logger.h:90
AurynDouble target_amplitude
Definition: CorrelatedPoissonGroup.h:81
Logger * logger
Global pointer to instance of Logger which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:36
Here is the call graph for this function:

◆ set_tau_amplitude()

void CorrelatedPoissonGroup::set_tau_amplitude ( AurynDouble  scale)
182 {
183  tau_amplitude = tau;
184  auryn::logger->parameter("tau_amplitude",tau_amplitude);
185 }
AurynDouble tau_amplitude
Definition: CorrelatedPoissonGroup.h:80
void parameter(std::string name, T value)
Definition: Logger.h:90
Logger * logger
Global pointer to instance of Logger which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:36
Here is the call graph for this function:

◆ set_threshold()

void CorrelatedPoissonGroup::set_threshold ( AurynDouble  threshold)
112 {
113  thr = std::max(1e-6,threshold);
114 }
AurynDouble thr
Definition: CorrelatedPoissonGroup.h:82

◆ set_timescale()

void CorrelatedPoissonGroup::set_timescale ( AurynDouble  scale)
176 {
177  timescale = scale;
178  auryn::logger->parameter("timescale",timescale);
179 }
void parameter(std::string name, T value)
Definition: Logger.h:90
Logger * logger
Global pointer to instance of Logger which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:36
AurynDouble timescale
Definition: CorrelatedPoissonGroup.h:70
Here is the call graph for this function:

Member Data Documentation

◆ amplitude

AurynDouble auryn::CorrelatedPoissonGroup::amplitude
protected

Stores parameters for moving amplitude for slow changes to correlations structure

◆ delay

AurynTime auryn::CorrelatedPoissonGroup::delay
protected

◆ delay_o

AurynDouble* auryn::CorrelatedPoissonGroup::delay_o
protected

◆ groupsize

NeuronID auryn::CorrelatedPoissonGroup::groupsize
protected

◆ lambda

AurynDouble auryn::CorrelatedPoissonGroup::lambda
protected

◆ mean

AurynDouble auryn::CorrelatedPoissonGroup::mean

◆ ngroups

NeuronID auryn::CorrelatedPoissonGroup::ngroups
protected

◆ o

AurynDouble auryn::CorrelatedPoissonGroup::o
protected

Stores Ornstein Uhlenbeck state

◆ offset

int auryn::CorrelatedPoissonGroup::offset
protected

◆ remainersize

NeuronID auryn::CorrelatedPoissonGroup::remainersize
protected

◆ target_amplitude

AurynDouble auryn::CorrelatedPoissonGroup::target_amplitude
protected

◆ tau_amplitude

AurynDouble auryn::CorrelatedPoissonGroup::tau_amplitude
protected

◆ thr

AurynDouble auryn::CorrelatedPoissonGroup::thr
protected

◆ timescale

AurynDouble auryn::CorrelatedPoissonGroup::timescale
protected

◆ tstop

AurynTime auryn::CorrelatedPoissonGroup::tstop
protected

◆ x

NeuronID* auryn::CorrelatedPoissonGroup::x
protected

Stores the hopping state


The documentation for this class was generated from the following files: