diff --git a/src/examples/simulator.cpp b/src/examples/simulator.cpp index 684e2ef31cab4f647e8dd20a4113642dfd5cd76c..a4cbc2ef52530d073bd8b74bf9aa53b52a6b174a 100644 --- a/src/examples/simulator.cpp +++ b/src/examples/simulator.cpp @@ -156,24 +156,34 @@ int main(int argc, char** argv){ ds.de_normalize_single(expected_output_norm, expected_output); /* Evaluate network on an arbitrary data-set and save results into the file */ - l4n::DataSet ds2; - - std::vector<double> inp, out; - for(double i = 0; i < 5; i++) { - inp = {i}; - out = {i+2}; - - ds2.add_data_pair(inp, out); - } + l4n::CSVReader reader2("/home/martin/Desktop/vstup_pozadovany_vystup.txt", "\t"); + reader2.read(); + std::vector<unsigned int> inp_indices = {0}; + std::vector<unsigned int> out_indices = {1}; + l4n::DataSet ds2 = reader2.get_data_set(&inp_indices, &out_indices); + std::ofstream output_file_2("eval_output.txt"); + +// std::vector<double> inp, out; +// for(double i = 0; i < 5; i++) { +// inp = {i}; +// out = {i+2}; +// +// ds2.add_data_pair(inp, out); +// } - output_file << std::endl << "Evaluating network on the dataset: " << std::endl; - ds2.store_data_text(&output_file); +// output_file << std::endl << "Evaluating network on the dataset: " << std::endl; + output_file_2 << std::endl << "Evaluating network on the dataset: " << std::endl; +// ds2.store_data_text(&output_file); + ds2.store_data_text(&output_file_2); - output_file << "Output and the error:" << std::endl; - mse.eval_on_data_set(&ds2, &output_file); +// output_file << "Output and the error:" << std::endl; + output_file_2 << std::endl << "Evaluating network on the dataset: " << std::endl; +// mse.eval_on_data_set(&ds2, &output_file); + mse.eval_on_data_set(&ds2, &output_file_2); /* Close the output file for writing */ output_file.close(); + output_file_2.close(); return 0;