Skip to content
Snippets Groups Projects
Commit 90512183 authored by Martin Beseda's avatar Martin Beseda
Browse files

ENH: Added a default compilation type (static) instead of an obligatory...

ENH: Added a default compilation type (static) instead of an obligatory DEPENDENCIES_LINK_TYPE parameter.
parents 0bfecaf8 580fc663
No related branches found
No related tags found
No related merge requests found
......@@ -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}")
......
Subproject commit 6a58c03865b11c2a21229c6e71b8cebf15a9c8fb
Subproject commit f66133343e03fad8d35e234c2f10bd791685466a
Subproject commit 4a853f9952708b5f1c57055a6c1944e2c4ad6544
Subproject commit fb8d7abab4c3de2ad2c1df0b80fdd7687628c8d6
//
// 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
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment