Question

#include "doublefann.h"
#include "fann_cpp.h"
#include <iostream>

using namespace std;

int main() {
    FANN::neural_net* sth = new FANN::neural_net();
    sth->create_standard(3, 1, 2, 1);
    double inputs[1] = {0.000005};
    double outputs[1] = {0.8};
    double *wynik;
    for(int i = 0; i < 1000; i++) {
        sth->train(inputs, outputs);
        wynik = sth->run(inputs);
        cout << wynik[0] << endl;
    }
}

I've got: 5.20981e-315, 5.201e-315, 5.19371e-315, 5.18769e-315, 5.18269e-315, 5.1786e-315.

What I am doing wrong?

Was it helpful?

Solution

Ok. I've got it. On http://leenissen.dk/fann/forum/viewtopic.php?t=354 is a solution. If you include "doublefann.h" you should link "-ldoublefann" instead "-lfann" in compiler options.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top