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

ENH: Added example - evaluation of external data and saving of results into the other file.

parent 763e5b24
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
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