add cmake build

This commit is contained in:
Artur Leonov
2018-09-20 13:53:39 +03:00
parent fdfad18674
commit f783728532
2 changed files with 50 additions and 2 deletions

View File

@@ -10,8 +10,10 @@
#include <fstream>
#include <vector>
#include <algorithm>
#include "easylogging++.h"
#ifdef MLP_EASYLOGGING
#include "easylogging++.h"
#endif
//desired call sintax : MLP({64*64,20,4}, {"sigmoid", "linear"},
@@ -206,7 +208,9 @@ void MLP::Train(const std::vector<TrainingSample> &training_sample_set_with_bias
temp_training << predicted_output[i];
}
temp_training << "]";
#ifdef MLP_EASYLOGGING
LOG(INFO) << temp_training.str();
#endif
}
for (int j = 0; j < predicted_output.size(); j++) {
@@ -221,13 +225,15 @@ void MLP::Train(const std::vector<TrainingSample> &training_sample_set_with_bias
learning_rate);
}
#ifdef MLP_EASYLOGGING
if (output_log && ((i % (max_iterations / 10)) == 0))
LOG(INFO) << "Iteration " << i << " cost function f(error): "
<< current_iteration_cost_function;
#endif
if (current_iteration_cost_function < min_error_cost)
break;
}
#ifdef MLP_EASYLOGGING
LOG(INFO) << "Iteration " << i << " cost function f(error): "
<< current_iteration_cost_function;
@@ -235,6 +241,7 @@ void MLP::Train(const std::vector<TrainingSample> &training_sample_set_with_bias
LOG(INFO) << "******* TRAINING ENDED *******";
LOG(INFO) << "******* " << i << " iters *******";
LOG(INFO) << "******************************";
#endif
//{
// int layer_i = -1;
// int node_i = -1;