diff --git a/src/examples/simulator.cpp b/src/examples/simulator.cpp index 785f0002e8b63805a988dc99c215fc90420d5425..9a44df758547b83c2b8f76e83fc73023382141a2 100644 --- a/src/examples/simulator.cpp +++ b/src/examples/simulator.cpp @@ -39,17 +39,20 @@ int main(int argc, char** argv){ try { /* Read data from the file */ - l4n::CSVReader reader("/home/martin/5Desktop/ANN_DATA_1_SET.txt", "\t", true); + l4n::CSVReader reader("/home/martin/Desktop/ANN_DATA_1_SET.txt", "\t", true); reader.read(); /* Create data set for both the training and testing of the neural network */ - std::vector<unsigned int> inputs = {2, 3, 4, 5, 6, 7, 8, 26, 27, 28}; + std::vector<unsigned int> inputs = {1}; std::vector<unsigned int> outputs = {17, 18, 19, 20, 21, 22, 23, 24, 25}; l4n::DataSet ds = reader.get_data_set(&inputs, &outputs); + ds.normalize(); + +// ds.print_data(); /* Neural network construction */ - std::vector<unsigned int> neuron_numbers_in_layers = {10, 10, 10, 9}; + std::vector<unsigned int> neuron_numbers_in_layers = {1, 10, 10, 9}; l4n::FullyConnectedFFN nn(&neuron_numbers_in_layers, l4n::NEURON_TYPE::LOGISTIC); /* Error function */ @@ -118,9 +121,12 @@ int main(int argc, char** argv){ std::cout << "error of the " << data_idx << "-th element: " << get_rel_error(output_norm, expected_output_norm) << std::endl; - } catch(const lib4neuro::FileNotFoundException& e) { + return 0; + + } catch(const std::runtime_error& e) { std::cout << e.what(); + + return -1; } - return 0; }