-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputRegion.h
More file actions
83 lines (61 loc) · 2.8 KB
/
InputRegion.h
File metadata and controls
83 lines (61 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* InputRegion.h
*
* Copyright 2018 OFTNAI. All rights reserved.
*
*/
#ifndef INPUTREGION_H
#define INPUTREGION_H
// Forward declarations
class Neuron;
class Param;
// Includes
#include "Region.h"
#include "InputNeuron.h"
#include <vector>
#include <string>
#include <gsl/gsl_randist.h>
#include "Utilities.h"
using std::vector;
using std::string;
class InputRegion : public Region {
private:
vector<vector<vector<float> > > data; // data[object][sample][0 1 .... numberOfSimultanousObjects]
vector<float> sample;
vector<u_short> stimuliSamplesInObject;
vector<double> objectDuration;
// Load file names from file list
void loadDataFile(const char * dataFile, float stepSize, u_short outputAtTimeStepMultiple);
// Get data by interpolating from loaded data
void linearInterpolate(u_short object, double time);
// Matlab counter part
void centerDistance(vector<float> & v, float width, float distance);
public:
~InputRegion();
// moved so input neurons can see, could have made into friend class, but wasnt bothtered
vector<float> horVisualPreferences;
vector<float> horEyePreferences;
// Read from data file
u_short nrOfObjects;
u_short samplingRate;
u_short numberOfSimultanousObjects;
float horVisualFieldSize;
float horEyePositionFieldSize;
// Derived from data read from file
u_short horVisualDimension;
u_short horEyeDimension;
double interSampleTime;
vector<unsigned long int> timeStepsInObject;
vector<unsigned long int> outputtedTimeStepsInObject;
unsigned long int timeStepsPerEpoch;
unsigned long int outputtedTimeStepsPerEpoch;
double epochDuration;
// Neurons[depth][rows][col]
vector<vector<vector<InputNeuron> > > Neurons;
// Init
void init(Param & p, const char * dataFile, gsl_rng * rngController);
// Load switch content from buffer
void setFiringRate(u_short object, double time);
Neuron * getNeuron(u_short depth, u_short row, u_short col);
};
#endif // INPUTREGION_H