sferes2 / nn2

**Sferes2 module** generic toolbox for evolving neural networks
13 stars 9 forks source link

example_dnn_nsga2 does not link #6

Open Antymon opened 5 years ago

Antymon commented 5 years ago

Recently added example_dnn_nsga2 causes 2 types of errors during the linking under g++:

1) ../modules/nn2/example_dnn_nsga2.cpp: In member function 'void FitXOR<Params, Exact>::eval(Indiv&)': ../modules/nn2/example_dnn_nsga2.cpp:156:25: error: 'powf' is not a member of 'std' fit -= std::powf(outf[0] - outputs[i], 2.0);

2) ../modules/nn2/example_dnn_nsga2.cpp:216:1: required from here /git/sferes2/sferes/ea/crowd.hpp:171:23: error: ... FitXOR, Params> >' has no member named 'data' assert((it)->data().size() == (it2)->data().size());

Antymon commented 5 years ago

As for the first problem: it seems to be gcc incompatibility, which can be solved by replacing all (2) std::powf calls with std::pow

As for the 2nd problem: it seems that the only purpose of the branch QD_nn 's existence is to counter this problem despite the fact that the example does not exist there. The solution is therefore to use changes of that branch. I locally merged it into master, but I understand there must have been a reason to keep things separate.

jbmouret commented 5 years ago

Hi

I will look into this, as example_dnn_nsga.cpp is still a work in progress. I am using clang and the powf probably comes from this.

jbmouret commented 5 years ago

(I probably did not see the other error as I did not compile in debug for a while)