From cef2f6b166ba1af4b7fc826641ba410e38508e76 Mon Sep 17 00:00:00 2001
From: Martin Beseda <martin.beseda@vsb.cz>
Date: Wed, 9 Jan 2019 16:32:50 +0100
Subject: [PATCH] ENH: added output to the file for more function in
 simulator.cpp

---
 src/examples/simulator.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/examples/simulator.cpp b/src/examples/simulator.cpp
index 1789b568..684e2ef3 100644
--- a/src/examples/simulator.cpp
+++ b/src/examples/simulator.cpp
@@ -53,7 +53,7 @@ int main(int argc, char** argv){
         // Creation of fully connected feed-forward network with linear activation functions for input and output
         // layers and the specified a.f. for the hidden ones
         std::vector<l4n::NEURON_TYPE> hidden_type_v = {l4n::NEURON_TYPE::LOGISTIC, l4n::NEURON_TYPE::LINEAR};
-        l4n::FullyConnectedFFN nn(&neuron_numbers_in_layers, &hidden_type_v);
+        l4n::FullyConnectedFFN nn(&neuron_numbers_in_layers, &hidden_type_v, &output_file);
 
         /* Error function */
         l4n::MSE mse(&nn, &ds);  // First parameter - neural network, second parameter - data-set
@@ -91,7 +91,7 @@ int main(int argc, char** argv){
         // 1) Threshold for the successful ending of the optimization - deviation from minima
         // 2) Number of iterations to reset step size to tolerance/10.0
         // 3) Maximal number of iterations - optimization will stop after that, even if not converged
-        l4n::GradientDescent gs(1e-3, 100, 200);
+        l4n::GradientDescent gs(1e-3, 100, 10);
 
         // Weight and bias randomization in the network according to the uniform distribution
         // Calling methods nn.randomize_weights() and nn.randomize_biases()
@@ -115,13 +115,13 @@ int main(int argc, char** argv){
         nn.save_text("test_net.4n");
 
         /* Check of the saved network - print to STDOUT */
-        std::cout << std::endl << "The original network info:" << std::endl;
+        std::cout << std::flush << std::endl << "The original network info:" << std::endl;
         nn.write_stats();
         nn.write_weights();
         nn.write_biases();
 
         l4n::NeuralNetwork nn_loaded("test_net.4n");
-        std::cout << std::endl << "The loaded network info:" << std::endl;
+        std::cout << std::flush << std::endl << "The loaded network info:" << std::endl;
         nn_loaded.write_stats();
         nn.write_weights();
         nn.write_biases();
-- 
GitLab