24 #define MAX_GPU_DEVICES 4
27 #define ESN_INPUT_SIZE 14 //the number of inputs to the ESN - 14 sensors for the emotive epoch headset
28 #define ESN_OUTPUT_SIZE 2 //the number of outputs to the ESN - ?
29 #define ESN_SPARCE 20 //the probability (%) of each connection
30 #define ESN_STRENGTH 0.2 //the range +- of each connection (actual strength is random within this range)
31 #define FEEDBACK 0 //switch feedback on (1) or off (0)
32 #define LEARNING_RATE 0.01 //the learning rate for percetron training
37 #include <cuda_runtime.h>
42 class ESN :
public yarp::os::Thread
52 size_t inputActivitySize;
54 size_t outputActivitySize;
55 size_t inputWeightsSize;
57 size_t outputWeightsSize;
71 float *newInputActivity;
73 float *outputActivity;
74 float *newOutputActivity;
75 float *PERCoutputWeights;
76 float *PERCinputWeights;
77 float *PERCoutputTarget;
78 float *PERCinputTarget;
84 void calculateActivity(
float *activity,
int N,
float *weights,
float *newActivity,
int noElements);
85 void PERCweightsUpdate(
float *activity,
float *PERCactivity,
float *PERCweights,
float *target,
float learningRate,
int noPercUnits,
int size);
86 void finishStep (
float *newActivity,
float *activity,
int noElements,
float *newOutActivity,
float *outActivity,
int noOutElements,
float *newInputActivity,
float *inputActivity,
int noInputElements,
int inputClamp,
int outputClamp);
91 void printGPUProperties(
int deviceID);
93 void printConfiguration();
95 void setGPUMode(
bool gpuMode);
96 void setDevice(
int deviceID);
98 void setDebuggingLevel(
int level);
99 void setInputSource(
int source);
101 void getActivityAsBottle(Bottle *bottle);
104 int getDebuggingLevel();
105 vector<string> queryGPU();