diff --git a/gui/NeuroUI/netlearner.cpp b/gui/NeuroUI/netlearner.cpp index 4c68822..4db9939 100644 --- a/gui/NeuroUI/netlearner.cpp +++ b/gui/NeuroUI/netlearner.cpp @@ -1,10 +1,14 @@ #include "netlearner.h" #include "../../Net.h" +#include + void NetLearner::run() { try { + QElapsedTimer timer; + Net myNet({2, 3, 1}); size_t batchSize = 5000; @@ -12,6 +16,8 @@ void NetLearner::run() double batchMaxError = 0.0; double batchMeanError = 0.0; + timer.start(); + size_t numIterations = 1000000; for (size_t iteration = 0; iteration < numIterations; ++iteration) { @@ -59,6 +65,13 @@ void NetLearner::run() emit progress((double)iteration / (double)numIterations); } + QString timerLogString; + timerLogString.append("Elapsed time: "); + timerLogString.append(QString::number(timer.elapsed() / 1000.0)); + timerLogString.append(" seconds"); + + emit logMessage(timerLogString); + myNet.save("mynet.nnet"); } catch (std::exception &ex)