Skip to content
Browse files

Changed ANN activation function, fixed training data format

  • Loading branch information...
1 parent c99eafd commit cc646ff1cd6ac9296d6185fc58005d358a5f7eca @darylldoyle committed Mar 9, 2012
Showing with 6 additions and 85 deletions.
  1. +1 −1 command line/main.c
  2. +4 −4 command line/train.h
  3. +1 −80 command line/train_test.data
View
2 command line/main.c
@@ -35,7 +35,7 @@ int main()
exit(0);
else if(strcmp ( usr_input, "train" ) == 0 )
// train(input, output, hidden, max_epochs);
- train(6,4,3,3000);
+ train(6,4,5,20000);
else if(strcmp ( usr_input, "test" ) == 0 )
test();
else if(strcmp ( usr_input, "params" ) == 0 )
View
8 command line/train.h
@@ -12,7 +12,7 @@ int train(const unsigned int num_input, const unsigned int num_output, const uns
// Set layers. 3 is one layer hidden
const unsigned int num_layers = 3;
// Desired error
- const float desired_error = (const float) 0.00;
+ const float desired_error = (const float) 0.002;
// Epochs between reports
const unsigned int epochs_between_reports = 100;
struct fann *ann;
@@ -24,13 +24,13 @@ int train(const unsigned int num_input, const unsigned int num_output, const uns
printf("Fixing The Trains - Train Network.\n\n");
ann = fann_create_standard(num_layers, num_input, num_neurons_hidden, num_output);
- data = fann_read_train_from_file("train_test.data");
+ data = fann_read_train_from_file("train_test.old.data");
fann_set_activation_steepness_hidden(ann, 1);
fann_set_activation_steepness_output(ann, 1);
- fann_set_activation_function_hidden(ann, FANN_SIGMOID);
- fann_set_activation_function_output(ann, FANN_SIGMOID);
+ fann_set_activation_function_hidden(ann, FANN_SIGMOID_SYMMETRIC);
+ fann_set_activation_function_output(ann, FANN_SIGMOID_SYMMETRIC);
fann_set_train_stop_function(ann, FANN_STOPFUNC_BIT);
fann_set_bit_fail_limit(ann, 0.01f);
View
81 command line/train_test.data
@@ -1,4 +1,4 @@
-6 6 4
+10 6 4
0.000000 0 1 1 0 0.690909
0.000000 1 1 0
1.000000 0 1 1 1 0.000000
@@ -7,85 +7,6 @@
0.555556 0 1 0
0.642857 0 1 1 0 0.581818
0.555556 0 1 0
-0.000000 0 1 1 0 0.690909
-0.000000 1 1 0
-1.000000 0 1 1 1 0.000000
-1.000000 0 1 0
-0.642857 0 1 1 0 0.745455
-0.555556 0 1 0
-0.642857 0 1 1 0 0.581818
-0.555556 0 1 0
-0.428571 0 1 1 0 0.781818
-0.000000 0 1 0
-0.428571 0 1 1 1 0.000000
-0.000000 0 0 1
-0.428571 0 0 0 1 0.000000
-0.000000 0 0 1
-1.000000 1 0 1 1 0.000000
-0.000000 0 1 0
-1.000000 0 1 1 1 0.000000
-1.000000 0 1 0
-1.000000 0 1 1 0 0.363636
-1.000000 0 1 0
-0.428571 0 1 1 0 0.781818
-0.000000 0 1 0
-0.428571 0 1 1 1 0.000000
-0.000000 0 0 1
-0.000000 0 1 1 0 0.690909
-0.000000 1 1 0
-1.000000 0 1 1 1 0.000000
-1.000000 0 1 0
-0.642857 0 1 1 0 0.745455
-0.555556 0 1 0
-0.642857 0 1 1 0 0.581818
-0.555556 0 1 0
-0.428571 0 1 1 0 0.781818
-0.000000 0 1 0
-0.428571 0 1 1 1 0.000000
-0.000000 0 0 1
-0.428571 0 0 0 1 0.000000
-0.000000 0 0 1
-1.000000 1 0 1 1 0.000000
-0.000000 0 1 0
-1.000000 0 1 1 1 0.000000
-1.000000 0 1 0
-1.000000 0 1 1 0 0.363636
-1.000000 0 1 0
-0.428571 0 0 0 1 0.000000
-0.000000 0 0 1
-1.000000 1 0 1 1 0.000000
-0.000000 0 1 0
-0.000000 0 1 1 0 0.690909
-0.000000 1 1 0
-1.000000 0 1 1 1 0.000000
-1.000000 0 1 0
-0.642857 0 1 1 0 0.745455
-0.555556 0 1 0
-0.642857 0 1 1 0 0.581818
-0.555556 0 1 0
-0.428571 0 1 1 0 0.781818
-0.000000 0 1 0
-0.428571 0 1 1 1 0.000000
-0.000000 0 0 1
-0.428571 0 0 0 1 0.000000
-0.000000 0 0 1
-1.000000 1 0 1 1 0.000000
-0.000000 0 1 0
-1.000000 0 1 1 1 0.000000
-1.000000 0 1 0
-1.000000 0 1 1 0 0.363636
-1.000000 0 1 0
-1.000000 0 1 1 1 0.000000
-1.000000 0 1 0
-1.000000 0 1 1 0 0.363636
-1.000000 0 1 00.000000 0 1 1 0 0.690909
-0.000000 1 1 0
-1.000000 0 1 1 1 0.000000
-1.000000 0 1 0
-0.642857 0 1 1 0 0.745455
-0.555556 0 1 0
-0.642857 0 1 1 0 0.581818
-0.555556 0 1 0
0.428571 0 1 1 0 0.781818
0.000000 0 1 0
0.428571 0 1 1 1 0.000000

0 comments on commit cc646ff

Please sign in to comment.
Something went wrong with that request. Please try again.