Functions | |
double | unitStep (double x) |
double | sigmoid (double x) |
double | squareError (const std::vector< double > &v1, const std::vector< double > &v2) |
Utility functions for neural networks
double NNetUtil::sigmoid | ( | double | x | ) |
Sigmoid function
y(x) = 1 / (1 + exp(-x))
x | input to sigmoid |
double NNetUtil::squareError | ( | const std::vector< double > & | v1, |
const std::vector< double > & | v2 | ||
) |
Calculate the square error of two vectors Scaled with (1/2) to normalize derivative
E(v1, v2) = (1/2) |v2 - v1|^2
v1 | first vector |
v2 | second vector |
double NNetUtil::unitStep | ( | double | x | ) |
Unit step function
y(x) = 0 if x < 0
y(x) = 1 if x >= 0
x | input to step function |