-2

I am trying to work with FANN, I want function approximation. I do not know if there is a correlation between my data and my outputs so I cannot tell if this output means there is no correlation or if I am doing this wrong.

Here is my training program, I link -ldoublefann

#include "fann.h"

int main()
{
        const float connection_rate = 1;
        const float learning_rate = 0.7;
        const unsigned int num_input = 14;
        const unsigned int num_output = 2;
        const unsigned int num_layers = 3;
        const unsigned int num_neurons_hidden = 4;
        const float desired_error = 0.0001;
        const unsigned int max_iterations = 20000;
        const unsigned int iterations_between_reports = 1000;

        struct fann *ann = fann_create_standard (num_layers,
                num_input, num_neurons_hidden, num_output);

        fann_train_on_file(ann, "t120.train", max_iterations,
                iterations_between_reports, desired_error);

        fann_save(ann, "t120.net");

        fann_destroy(ann);

        return 0;
}

My Makefile

CFLAGS=-ldoublefann

all: train
train: train.c

The output is as follows:

Max epochs    20000. Desired error: 0.0001000000.
Epochs            1. Current error: 1426.2332763672. Bit fail 568.
Epochs         1000. Current error: 1403.6292724609. Bit fail 569.
Epochs         2000. Current error: 1403.6292724609. Bit fail 569.
Epochs         3000. Current error: 1403.6292724609. Bit fail 569.
Epochs         4000. Current error: 1403.6292724609. Bit fail 569.
Epochs         5000. Current error: 1403.6292724609. Bit fail 569.

I am looking at this and it makes some initial progress then stops cold. I do not know what bit fail means and that maybe my issue, it may think I am doing binary data instead of double precision floating point.

Here is my data:

My Data was too large to add to the post

My data consists of about 285 lines with 14 inputs and 2 outputs.

Am I doing this correctly and it does not correlate? Or did I do something wrong?

Bodger
  • 1,342
  • 4
  • 16
  • 23
  • I have no experience with FANN, just stumbled over your question. However, in the related questions sections I found this: http://stackoverflow.com/questions/12921798/what-is-the-purpose-of-bit-fail-in-fann?rq=1 After the reading the answers there, to me as an 'outsider' it looks like you're doing it right but FANN can't "make sense" of your data, i.e. there's no correlation involved. – Kevin Dreßler Oct 24 '15 at 18:03
  • Thank you Kevin, let's see if anyone can comment on my code. I did not see any examples of this style usage. – Bodger Oct 24 '15 at 20:53

1 Answers1

0

You need to either:

  1. #include "fann.h" and link -lfann
  2. #include "doublefann.h" and link -ldoublefann

See this discussion and this question, where someone had a similar issue.

Community
  • 1
  • 1
guivenca
  • 159
  • 1
  • 11