20 #ifndef SUPERNN_UTILS_HPP
21 #define SUPERNN_UTILS_HPP
67 const char*
what()
const throw()
69 return "SuperNN exception";
107 inline double limit(
double min,
double max,
double value)
109 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
void rand_seed()
Initializes the random number generator.
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.