cifar10_cifar10Classifier_calculateClass.h 532 Bytes
Newer Older
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
#ifndef CIFAR10_CIFAR10CLASSIFIER_CALCULATECLASS
#define CIFAR10_CIFAR10CLASSIFIER_CALCULATECLASS
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#include "armadillo"
using namespace arma;
class cifar10_cifar10Classifier_calculateClass{
const int n = 10;
public:
colvec inputVector;
double maxIndex;
void init()
{
inputVector=colvec(n);
}
void execute()
{
maxIndex = 0;
double maxValue = inputVector(0);
for( auto i=1;i<=(n-1);++i){
if((inputVector(i) > maxValue)){
maxIndex = i;
maxValue = inputVector(i);
}
}
}

};
#endif