I would like to make a neural network model to perform a regression task on some data using the dlib(dlib-19.1) library in c++(in visual studio(VS) 2013). Here is a link on how to set dlib with VS 2013. The code I have tried for this task is listed bellow, however I do not get correct results... I have searched the internet for a solution and I did not find anything helpful...
typedef matrix<double, 7, 1> sample_type;
typedef matrix<double, 2, 1> truth;
sample_type sample[10000];
truth gt[10000];
//// Create a multi-layer perceptron network.
mlp::kernel_1a_c net(7, 6,0,2);
ifstream fin("E:\\dataNN.txt");
int index = 0;
while (!fin.eof())
{
fin >> sample[index](0) >> sample[index](1) >> sample[index](2) >> sample[index](3) >> sample[index](4) >> sample[index](5) >> sample[index](6) >> gt[index](0) >> gt[index](1);
index++;
}
fin.close();
for (int i = 0; i < 1000; ++i)
{
for (int j = 0; j < 90; j++)
{
net.train(sample[j], gt[j]);
}
cout << "Epoch " << i << "\n";
}
for (int j = 91; j < 106; j++)
cout << "This sample should be close to " << gt[j](0) << " " << gt[j](1) << " net result " << net(sample[j])(0) << " " << net(sample[j])(1) << "\n";
Can anyone give me a hint on how can I solve this issue?