title: FANN doesn't train properly
body: <p>I am trying to approximate the square function with FANN. The code follows:</p>
  
  <pre><code>#include "../FANN-2.2.0-Source/src/include/doublefann.h"
  #include "../FANN-2.2.0-Source/src/include/fann_cpp.h"
  #include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  using namespace FANN;
  
  //Remember: fann_type is double!
  int main(int argc, char** argv) {
      //create a test network: [1,2,1] MLP
      neural_net * net = new neural_net;
      const unsigned int layers[3] = {1,3,1};
      net-&gt;create_standard_array(3,layers);
  
      //net-&gt;create_standard(num_layers, num_input, num_hidden, num_output);
  
      net-&gt;set_learning_rate(0.7f);
  
      net-&gt;set_activation_steepness_hidden(0.7);
      net-&gt;set_activation_steepness_output(0.7);
  
      net-&gt;set_activation_function_hidden(SIGMOID_SYMMETRIC_STEPWISE);
      net-&gt;set_activation_function_output(SIGMOID_SYMMETRIC_STEPWISE);
      net-&gt;set_training_algorithm(TRAIN_QUICKPROP);
  
      //cout&lt;&lt;net-&gt;get_train_error_function()
      //exit(0);
      //test the number 2
      fann_type * testinput = new fann_type;
      *testinput = 2;
      fann_type * testoutput = new fann_type;
      *testoutput = *(net-&gt;run(testinput));
      double outputasdouble = (double) *testoutput;
      cout&lt;&lt;"Test output: "&lt;&lt;outputasdouble&lt;&lt;endl;
  
      //make a training set of x-&gt;x^2
      training_data * squaredata = new training_data;
      squaredata-&gt;read_train_from_file("trainingdata.txt");
  
      net-&gt;train_on_data(*squaredata,1000,100,0.001);
  
      cout&lt;&lt;endl&lt;&lt;"Easy!";
      return 0;
  }
  </code></pre>
  
  <p>trainingdata.txt is this:</p>
  
  <pre><code>10 1 1
  1 1
  2 4
  3 9
  4 16
  5 25
  6 36
  7 49
  8 64
  9 81
  10 100
  </code></pre>
  
  <p>I feel that I have done everything right with the API. However, when I run it, I get huge error that never seems to reduce with training.</p>
  
  <pre><code>Test output: -0.0311087
  Max epochs     1000. Desired error: 0.0010000000.
  Epochs            1. Current error: 633.9928588867. Bit fail 10.
  Epochs          100. Current error: 614.3250122070. Bit fail 9.
  Epochs          200. Current error: 614.3250122070. Bit fail 9.
  Epochs          300. Current error: 614.3250122070. Bit fail 9.
  Epochs          400. Current error: 614.3250122070. Bit fail 9.
  Epochs          500. Current error: 614.3250122070. Bit fail 9.
  Epochs          600. Current error: 614.3250122070. Bit fail 9.
  Epochs          700. Current error: 614.3250122070. Bit fail 9.
  Epochs          800. Current error: 614.3250122070. Bit fail 9.
  Epochs          900. Current error: 614.3250122070. Bit fail 9.
  Epochs         1000. Current error: 614.3250122070. Bit fail 9.
  
  Easy!
  </code></pre>
  
  <p>What have I done wrong?</p>