Skip to content
Snippets Groups Projects
Commit ccea58ad authored by Martin Beseda's avatar Martin Beseda
Browse files

[CODE] removed unnecessary comments in simulator_1_2.cpp

parent 40b93c16
No related branches found
No related tags found
No related merge requests found
......@@ -106,55 +106,55 @@ int main(int argc, char** argv) {
/* Complex Optimization */
learning_sequence.optimize(mse1); // Network training
//
// puts("*********************** 6");
//
// /* Save Neural network parameters to file */
// sim.save_text("test_net_Gradient_Descent.4n");
//
// /* PHASE 4 - TESTING DATA */
//
// /* Output file specification */
// std::string filename = "simulator_output.txt";
// std::ofstream output_file(filename);
// if (!output_file.is_open()) {
// throw std::runtime_error("File '" + filename + "' can't be opened!");
// }
//
// /* Neural network loading */
// l4n::NeuralNetwork nn3("test_net_Gradient_Descent.4n");
//
// /* Check of the saved network - write to the file */
// output_file << std::endl << "The loaded network info:" << std::endl;
// nn3.write_stats(&output_file);
// nn3.write_weights(&output_file);
// nn3.write_biases(&output_file);
////
//// /* Evaluate network on an arbitrary data-set and save results into the file */
// l4n::CSVReader reader3("../../../data_files/data_BACK_RH_1.csv", ";", true); // File, separator, skip 1st line
// reader3.read(); // Read from the file
////
//// /* Create data set for both the testing of the neural network */
//// /* Specify which columns are inputs or outputs */
////
// std::shared_ptr<l4n::DataSet> ds3 = reader3.get_data_set(&inputs, &outputs); // Creation of data-set for NN
// ds3.operator->()->set_normalization_strategy( new DoubleUnitStrategy());
// if(normalize_data){
// ds3.get()->normalize(); // Normalization of data to prevent numerical problems
// }
////
//// output_file << std::endl << "Evaluating network on the dataset: " << std::endl;
//// ds3.store_data_text(&output_file);
////
// output_file << "Output and the error:" << std::endl;
////
//// /* Error function */
// l4n::MSE mse3(&nn3, ds3.get()); // First parameter - neural network, second parameter - data-set
//
// mse3.eval_on_data_set(ds3.get(), &output_file, nullptr, normalize_data, true);
//
// /* Close the output file for writing */
// output_file.close();
puts("*********************** 6");
/* Save Neural network parameters to file */
sim.save_text("test_net_Gradient_Descent.4n");
/* PHASE 4 - TESTING DATA */
/* Output file specification */
std::string filename = "simulator_output.txt";
std::ofstream output_file(filename);
if (!output_file.is_open()) {
throw std::runtime_error("File '" + filename + "' can't be opened!");
}
/* Neural network loading */
l4n::NeuralNetwork nn3("test_net_Gradient_Descent.4n");
/* Check of the saved network - write to the file */
output_file << std::endl << "The loaded network info:" << std::endl;
nn3.write_stats(&output_file);
nn3.write_weights(&output_file);
nn3.write_biases(&output_file);
/* Evaluate network on an arbitrary data-set and save results into the file */
l4n::CSVReader reader3("../../../data_files/data_BACK_RH_1.csv", ";", true); // File, separator, skip 1st line
reader3.read(); // Read from the file
/* Create data set for both the testing of the neural network */
/* Specify which columns are inputs or outputs */
std::shared_ptr<l4n::DataSet> ds3 = reader3.get_data_set(&inputs, &outputs); // Creation of data-set for NN
ds3.operator->()->set_normalization_strategy( new DoubleUnitStrategy());
if(normalize_data){
ds3.get()->normalize(); // Normalization of data to prevent numerical problems
}
output_file << std::endl << "Evaluating network on the dataset: " << std::endl;
ds3->store_data_text(&output_file);
output_file << "Output and the error:" << std::endl;
/* Error function */
l4n::MSE mse3(&nn3, ds3.get()); // First parameter - neural network, second parameter - data-set
mse3.eval_on_data_set(ds3.get(), &output_file, nullptr, normalize_data, true);
/* Close the output file for writing */
output_file.close();
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment