MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SeqSynHandler.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2016 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #ifndef _SEQ_SYN_HANDLER_H
11 #define _SEQ_SYN_HANDLER_H
12 
27 {
28  public:
29  SeqSynHandler();
31  SeqSynHandler& operator=( const SeqSynHandler& other );
32 
34  // Over-ridden virtual functions
36  void vSetNumSynapses( unsigned int num );
37  unsigned int vGetNumSynapses() const;
38  Synapse* vGetSynapse( unsigned int i );
39  void vProcess( const Eref& e, ProcPtr p );
40  void vReinit( const Eref& e, ProcPtr p );
41 
44  unsigned int addSynapse();
45  void dropSynapse( unsigned int droppedSynNumber );
46  void addSpike( unsigned int index, double time, double weight );
47  double getTopSpike( unsigned int index ) const;
49  // New fields.
51  void setKernelEquation( string eq );
52  string getKernelEquation() const;
53  void setKernelWidth( unsigned int v );
54  unsigned int getKernelWidth() const;
55  void setSeqDt( double v );
56  double getSeqDt() const;
57  void setHistoryTime( double v );
58  double getHistoryTime() const;
59  void setBaseScale( double v );
60  double getBaseScale() const;
61  void setSequenceScale( double v );
62  double getSequenceScale() const;
63  void setSynapseOrder( vector< unsigned int> v );
64  vector< unsigned int> getSynapseOrder() const;
65  void setSynapseOrderOption( int v );
66  int getSynapseOrderOption() const;
67  double getSeqActivation() const; // summed activation of syn chan
68  void setPlasticityScale( double v );
69  double getPlasticityScale() const;
70  void setSequencePower( double v );
71  double getSequencePower() const;
72  vector< double > getWeightScaleVec() const;
73  vector< double > getKernel() const;
74  vector< double > getHistory() const;
75 
77  // Utility func
78  int numHistory() const;
79  void refillSynapseOrder( unsigned int newSize );
80  void fixSynapseOrder();
82  static const Cinfo* initCinfo();
83  private:
84  void updateKernel();
85  /*
86  * Here I would like to put in a sparse matrix.
87  * Each timestep is a row
88  * Each column is a neuron
89  * Each value is the weight, though I could also look this up.
90  * I need to make it a circular buffer.
91  * The 'addRow' function inserts the non-zero entries representing
92  * neurons that are active on this timestep. As a circular buffer
93  * this needs to do some allocation juggling.
94  * Need a new function similar to computeRowRate, basically a
95  * dot product of input vector with specified row.
96  * Then run through all available places.
97  */
99  unsigned int kernelWidth_; // Width in terms of number of synapses
100 
102  double historyTime_;
103  double seqDt_; // Time step for successive entries in kernel
105  double baseScale_;
108 
114 
123 
125  // Some readonly fields
126  double seqActivation_; // global activation if sequence recognized
127 
128  // Weight scaling based on individual synapse sequence tuning.
129  vector< double > weightScaleVec_;
130 
132  // Tracks the spikes that came in recently, as input to correlation
133  // analysis for sequence recognition.
134  vector< double > latestSpikes_;
135 
137  vector< vector< double > > kernel_;
139 
149  vector< unsigned int > synapseOrder_;
150 
154 
155  vector< Synapse > synapses_;
156  priority_queue< PreSynEvent, vector< PreSynEvent >, CompareSynEvent > events_;
157 
158 
159 };
160 
161 #endif // _SEQ_SYN_HANDLER_H
vector< double > getKernel() const
double getBaseScale() const
double seqActivation_
vector< Synapse > synapses_
unsigned int addSynapse()
Adds a new synapse, returns its index.
vector< double > getWeightScaleVec() const
double getTopSpike(unsigned int index) const
priority_queue< PreSynEvent, vector< PreSynEvent >, CompareSynEvent > events_
double getSequenceScale() const
void setPlasticityScale(double v)
void vProcess(const Eref &e, ProcPtr p)
double getSequencePower() const
vector< unsigned int > getSynapseOrder() const
void addSpike(unsigned int index, double time, double weight)
void vReinit(const Eref &e, ProcPtr p)
void setKernelEquation(string eq)
SeqSynHandler & operator=(const SeqSynHandler &other)
string getKernelEquation() const
void dropSynapse(unsigned int droppedSynNumber)
void refillSynapseOrder(unsigned int newSize)
double plasticityScale_
double getPlasticityScale() const
double historyTime_
Time to store history. KernelDt defines num of rows.
Synapse * vGetSynapse(unsigned int i)
vector< double > weightScaleVec_
double getSeqDt() const
void setKernelWidth(unsigned int v)
void setSeqDt(double v)
int getSynapseOrderOption() const
void vSetNumSynapses(unsigned int num)
static const Cinfo * initCinfo()
double getSeqActivation() const
void fixSynapseOrder()
double baseScale_
Scaling factor for baseline synaptic responses.
void setSynapseOrderOption(int v)
int numHistory() const
Definition: Eref.h:26
vector< vector< double > > kernel_
vector< double > getHistory() const
RollingMatrix history_
Kernel for seq selectivity.
unsigned int vGetNumSynapses() const
void setSequencePower(double v)
void setSynapseOrder(vector< unsigned int > v)
unsigned int getKernelWidth() const
string kernelEquation_
Definition: SeqSynHandler.h:98
void setBaseScale(double v)
void setHistoryTime(double v)
vector< double > latestSpikes_
unsigned int kernelWidth_
Definition: SeqSynHandler.h:99
double getHistoryTime() const
Definition: Cinfo.h:18
void setSequenceScale(double v)
vector< unsigned int > synapseOrder_
Rows = time; cols = synInputs.
double sequencePower_
double sequenceScale_
Scaling factor for sequence recognition responses.