From 20cd0fcf0e1188eb577cefcdfdf453fa82996777 Mon Sep 17 00:00:00 2001 From: Martin Beseda <martin.beseda@vsb.cz> Date: Tue, 18 Dec 2018 01:06:28 +0100 Subject: [PATCH] FIX: added data-set normalization to the example net_test_1 to prevent 'nan' results returned by Gradient descent method. --- src/examples/net_test_1.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/examples/net_test_1.cpp b/src/examples/net_test_1.cpp index 33451e6c..372fa3dc 100644 --- a/src/examples/net_test_1.cpp +++ b/src/examples/net_test_1.cpp @@ -141,5 +141,10 @@ int main() { net.randomize_parameters(); optimize_via_gradient_descent( net, mse ); + /* Normalize data to prevent 'nan' results */ + ds.normalize(); + net.randomize_parameters(); + optimize_via_gradient_descent(net, mse); + return 0; } -- GitLab