diff --git a/CMakeLists.txt b/CMakeLists.txt index 07ccb92883966bf91cb342e31604ff254e520c4e..c10de69ad341cfc5125871f294aa6d34488e2730 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,10 +31,9 @@ endif (NOT CMAKE_BUILD_TYPE) # Dependencies link type # #------------------------# if(NOT DEPENDENCIES_LINK_TYPE AND NOT ENV{DEPENDENCIES_LINK_TYPE}) - message(FATAL_ERROR "Please, set the variable DEPENDENCIES_LINK_TYPE to either 'static' or 'shared'!") -endif() - -if(ENV{DEPENDENCIES_LINK_TYPE}) + set(DEPENDENCIES_LINK_TYPE "static") + message("DEPENDENCIES_LINK_TYPE is not specified - lib4neuro is going to be linked statically.") +elseif(ENV{DEPENDENCIES_LINK_TYPE}) set(DEPENDENCIES_LINK_TYPE ENV{DEPENDENCIES_LINK_TYPE}) endif() @@ -84,10 +83,6 @@ if(NOT Boost_FOUND) message(FATAL_ERROR "Boost was NOT found! Specify variables BOOST_INCLUDEDIR and BOOST_LIBRARYDIR!") endif() -message("Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}") -message("Boost_LIBRARY_DIRS: ${Boost_LIBRARY_DIRS}") -message("Boost_LIBRARIES: ${Boost_LIBRARIES}") - find_package(exprtk) message("EXPRTK_INCLUDE_DIRS: ${EXPRTK_INCLUDE_DIRS}") diff --git a/external_dependencies/boost b/external_dependencies/boost index 6a58c03865b11c2a21229c6e71b8cebf15a9c8fb..f66133343e03fad8d35e234c2f10bd791685466a 160000 --- a/external_dependencies/boost +++ b/external_dependencies/boost @@ -1 +1 @@ -Subproject commit 6a58c03865b11c2a21229c6e71b8cebf15a9c8fb +Subproject commit f66133343e03fad8d35e234c2f10bd791685466a diff --git a/external_dependencies/turtle b/external_dependencies/turtle index 4a853f9952708b5f1c57055a6c1944e2c4ad6544..fb8d7abab4c3de2ad2c1df0b80fdd7687628c8d6 160000 --- a/external_dependencies/turtle +++ b/external_dependencies/turtle @@ -1 +1 @@ -Subproject commit 4a853f9952708b5f1c57055a6c1944e2c4ad6544 +Subproject commit fb8d7abab4c3de2ad2c1df0b80fdd7687628c8d6 diff --git a/src/Exception/Exceptions.cpp b/src/Exception/Exceptions.cpp deleted file mode 100644 index 8f6444d66a1c8ddd14a4a5cd08dc3ab2d652b2a7..0000000000000000000000000000000000000000 --- a/src/Exception/Exceptions.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// -// Created by martin on 9/19/18. -// - -#include "Exceptions.h" - -namespace lib4neuro { - - InvalidDimension::InvalidDimension() : std::runtime_error("Invalid dimension specified!") {}; - InvalidDimension::InvalidDimension(std::string msg) : std::runtime_error(msg.c_str()) {}; - - NotImplementedException::NotImplementedException() : std::runtime_error( - "This functions is not implemented yet!") {}; - NotImplementedException::NotImplementedException(std::string msg) : std::runtime_error(msg.c_str()) {}; - - FileNotFoundException::FileNotFoundException() : std::runtime_error("The file was not found!") {}; - FileNotFoundException::FileNotFoundException(std::string msg) : std::runtime_error(msg.c_str()) {}; - -} \ No newline at end of file diff --git a/src/LearningMethods/GradientDescent.h b/src/LearningMethods/GradientDescent.h index b072f7ce07e0a158b0fb82ade5590c3bd0a94617..a96b4a0076e9a57ce4faab024f29dbc96ee0999a 100644 --- a/src/LearningMethods/GradientDescent.h +++ b/src/LearningMethods/GradientDescent.h @@ -57,14 +57,22 @@ namespace lib4neuro { std::vector<double> *optimal_parameters; /** + * Adaptive calculation of the step-size based on several historical characteristics. + * ---------------------------------------------------------------------------------- + * If the current error @fi is larger than the error in the previous step @fim, the rate of step-size change decreases (the algorithm is going in the direction too quickly) + * Otherwise the rate of step-size change increases (the algorithm is on the right path, we can attempts to push through more rapidly) + * ---------------------------------------------------------------------------------- + * The step size is then calculated via: @c^(1-2@beta) * (@grad_norm_prev/@grad_norm)^(1/@c) + * If the previous gradient norm is lower then the current gradient norm, then the step-size decreases (as we probably took a too large of a step) + * Otherwise it increases (as we are likely on the right track, we can try to speed-up the convergence) * - * @param gamma - * @param beta - * @param c - * @param grad_norm_prev - * @param grad_norm - * @param fi - * @param fim + * @param gamma[in, out] a step size used in the last iteration + * @param beta[in] a number in the interval [0, 1]. it represents a measure of direction change between two last steps, 0: no change, 1:opposite directions + * @param c[in, out] greater than zero. it is a measure of a non-linear step-size change. the higher @c is, the more rapidly the step-size increases/decreases + * @param grad_norm_prev[in] gradient norm of the error in the previous iteration + * @param grad_norm[in] gradient norm of the error in the current iteration + * @param fi[in] value of the error + * @param fim[in] value of the error in the previous iteration */ virtual void eval_step_size_mk(double &gamma,