-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfannrun.cpp
More file actions
50 lines (38 loc) · 887 Bytes
/
Copy pathfannrun.cpp
File metadata and controls
50 lines (38 loc) · 887 Bytes
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
#include <stdio.h>
#include "floatfann.h"
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
template <class V> string printArray(V *array, int len) {
stringstream ss;
ss << "[";
for (int i = 0; i < len; i++) {
ss << array[i];
if (i < len-1)
ss << ", ";
}
ss << "]";
return ss.str();
}
int main()
{
fann_type *calc_out;
fann_type input[8];
struct fann *ann = fann_create_from_file("identity_float.net");
input[0] = 0;
input[1] = 1;
input[2] = 0;
input[3] = 0;
input[4] = 0;
input[5] = 0;
input[6] = 0;
input[7] = 0;
calc_out = fann_run(ann, input);
fann_print_connections(ann);
cout << "Identity test:" << endl
<< printArray(input, 8) << endl
<< printArray(calc_out, 8) << endl;
fann_destroy(ann);
return 0;
}