20 #ifndef SUPERNN_UTILS_HPP
21 #define SUPERNN_UTILS_HPP
27 #if defined (_MSC_VER)
28 #pragma warning(disable: 4251)
31 #define SUPERNN_EXPORT __declspec(dllexport)
33 #define SUPERNN_EXPORT
69 class SUPERNN_EXPORT
Exception :
public std::exception
77 const char*
what()
const throw()
79 return "SuperNN exception";
117 inline double limit(
double min,
double max,
double value)
119 return std::max(min, std::min(max, value));
Exception(ErrorType type=ERROR_GENERIC)
thrown when a file couldn't be opened
const unsigned file_precision
Precision used when writting floating point number to files.
thrown when training with a non-diferentiable activation function
SUPERNN_EXPORT void rand_seed()
Initializes the random number generator.
SUPERNN_EXPORT double rand_double(double max)
Returns a pseudo-random double.
thrown when calling a function with invalid parameters
thrown when no other type applies
ErrorType
Errors that the library can throw.
The exception can be identified by the type() method.
thrown when a matrix can't be solved/inverted
thrown when a file has invalid contents
thrown when the dimensions of a Row and the network does not match
const char * what() const
double limit(double min, double max, double value)
Returns the value limited to a range.