-
Notifications
You must be signed in to change notification settings - Fork 0
/
fanntest.cpp
28 lines (25 loc) · 1.05 KB
/
fanntest.cpp
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
#include "fann.h"
int main()
{
const unsigned int num_layers = 4;
const unsigned int num_input = 8;
const unsigned int num_output = 8;
const unsigned int num_neurons_hidden_a = 4;
const unsigned int num_neurons_hidden_b = 12;
const float desired_error = (const float) 0.001;
const unsigned int max_epochs = 500000;
const unsigned int epochs_between_reports = 1000;
struct fann *ann = fann_create_standard(
num_layers,
num_input,
num_neurons_hidden_a,
num_neurons_hidden_b,
num_output);
fann_set_activation_function_hidden(ann, FANN_SIGMOID_SYMMETRIC);
fann_set_activation_function_output(ann, FANN_SIGMOID_SYMMETRIC);
fann_train_on_file(ann, "identity.data", max_epochs,
epochs_between_reports, desired_error);
fann_save(ann, "identity_float.net");
fann_destroy(ann);
return 0;
}