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

A special PoissonGroup that generates jumping Gaussian bumps in the firing rate profile. More...

#include <MovingBumpGroup.h>

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

Public Member Functions

 MovingBumpGroup (NeuronID n, AurynFloat duration, AurynFloat width, AurynDouble rate=5.0, string tiserfile="stimulus.dat")
 Default constructor. More...
 
void set_floor (AurynFloat floor)
 Sets firing rate floor. More...
 
void set_width (NeuronID width)
 Sets width of Gaussian rate profile. More...
 
void set_duration (AurynFloat duration)
 Sets stimulus duration. More...
 
void set_interval (AurynFloat interval)
 Sets inter-stimulus interval. More...
 
virtual ~MovingBumpGroup ()
 
virtual void evolve ()
 
- Public Member Functions inherited from auryn::ProfilePoissonGroup
 ProfilePoissonGroup (NeuronID n, AurynDouble rate=5.)
 
virtual ~ProfilePoissonGroup ()
 
void set_rate (AurynDouble rate)
 
void normalize_profile ()
 
void set_profile (AurynFloat *newprofile)
 
void set_profile (auryn_vector_float *newprofile)
 
void set_flat_profile ()
 
void set_gaussian_profile (AurynDouble mean, AurynDouble sigma, AurynDouble floor=0.0)
 
AurynDouble get_rate ()
 
void seed (int s)
 
- 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

double pos_min
 Minimal relative position in group for center of bump (default = 0) More...
 
double pos_max
 Maximum relative position in group for center of bump (default = 1) More...
 
- 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
 

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...
 
- Protected Attributes inherited from auryn::ProfilePoissonGroup
NeuronID x
 
AurynDouble jumpsize
 
boost::uniform_01 * dist
 
boost::variate_generator< boost::mt19937 &, boost::uniform_01<> > * die
 
auryn_vector_floatprofile
 stores the spatial distribution of relative firing rates More...
 
- 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
 
- Static Protected Attributes inherited from auryn::ProfilePoissonGroup
static boost::mt19937 gen = boost::mt19937()
 
- Static Protected Attributes inherited from auryn::SpikingGroup
static AurynTimeclock_ptr = NULL
 

Detailed Description

A special PoissonGroup that generates jumping Gaussian bumps in the firing rate profile.

This type of stimulation can be used as a standart sanity test for plastic Connection classes to see whether or not they develop selectivity through some sort of competitive mechanism.

Constructor & Destructor Documentation

◆ MovingBumpGroup()

MovingBumpGroup::MovingBumpGroup ( NeuronID  n,
AurynFloat  duration,
AurynFloat  width,
AurynDouble  rate = 5.0,
std::string  tiserfile = "stimulus.dat" 
)

Default constructor.

Parameters
nSize of the group
durationDuration of constant stimulation with a given stimulus profile in s
widthThe relative width of the bump
rateBase firing rate
tiserfileTimeseries file for logging of bump position
76  : ProfilePoissonGroup( n , rate )
77 {
78  init(duration, width, tiserfile );
79 }
int n
Definition: mkpat.py:5
ProfilePoissonGroup(NeuronID n, AurynDouble rate=5.)
Definition: ProfilePoissonGroup.cpp:54

◆ ~MovingBumpGroup()

MovingBumpGroup::~MovingBumpGroup ( )
virtual
82 {
83  tiserfile.close();
84 }

Member Function Documentation

◆ evolve()

void MovingBumpGroup::evolve ( )
virtual

Evolve function for internal use by System

Reimplemented from auryn::ProfilePoissonGroup.

108 {
109  if ( auryn::sys->get_clock() >= next_event ) {
110  if ( stimulus_active && stimulus_interval>0 ) {
111  next_event += stimulus_interval;
112  stimulus_active = false;
114  } else {
115  next_event += stimulus_duration;
116  stimulus_active = true;
117 
118  boost::uniform_int<> dist(pos_min*get_size(),pos_max*get_size());
119  boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(order_gen, dist);
120 
121  NeuronID mean = die();
122  tiserfile << auryn::sys->get_time() << " " << mean << std::endl;
123  set_gaussian_profile(mean, profile_width, floor_);
124  }
125  }
126 
128 }
void set_flat_profile()
Definition: ProfilePoissonGroup.cpp:97
void set_gaussian_profile(AurynDouble mean, AurynDouble sigma, AurynDouble floor=0.0)
Definition: ProfilePoissonGroup.cpp:132
double pos_max
Maximum relative position in group for center of bump (default = 1)
Definition: MovingBumpGroup.h:82
boost::uniform_01 * dist
Definition: ProfilePoissonGroup.h:68
virtual void evolve()
Definition: ProfilePoissonGroup.cpp:157
System * sys
Global pointer to instance of System which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:37
AurynDouble get_time()
Gets the current system time in [s].
Definition: System.cpp:226
NeuronID get_size()
Returns the size of the group.
Definition: SpikingGroup.cpp:304
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
boost::variate_generator< boost::mt19937 &, boost::uniform_01<> > * die
Definition: ProfilePoissonGroup.h:69
double pos_min
Minimal relative position in group for center of bump (default = 0)
Definition: MovingBumpGroup.h:80
Here is the call graph for this function:

◆ set_duration()

void MovingBumpGroup::set_duration ( AurynFloat  duration)

Sets stimulus duration.

duration is given in units of s

Parameters
durationthe new stimulus duration in s
97 {
98  stimulus_duration = duration/auryn_timestep;
99 }
double auryn_timestep
Simulation timestep in seconds.
Definition: auryn_definitions.cpp:31

◆ set_floor()

void MovingBumpGroup::set_floor ( AurynFloat  floor)

Sets firing rate floor.

Floor is given in relative units with respect to the maximum amplitude in the Gaussian

87 {
88  floor_ = floor;
89 }

◆ set_interval()

void MovingBumpGroup::set_interval ( AurynFloat  interval)

Sets inter-stimulus interval.

Parameters
intervalgiven in units of s
102 {
103  stimulus_interval = interval/auryn_timestep;
104 }
double auryn_timestep
Simulation timestep in seconds.
Definition: auryn_definitions.cpp:31

◆ set_width()

void MovingBumpGroup::set_width ( NeuronID  width)

Sets width of Gaussian rate profile.

Width is given in relative units of neurons and characterizes the stdev of the Gaussian dist

92 {
93  profile_width = width;
94 }

Member Data Documentation

◆ pos_max

double auryn::MovingBumpGroup::pos_max

Maximum relative position in group for center of bump (default = 1)

◆ pos_min

double auryn::MovingBumpGroup::pos_min

Minimal relative position in group for center of bump (default = 0)


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