NNetCpp
Neural network implementation in C++
 All Classes Namespaces Functions Variables
Functions
NNetUtil Namespace Reference

Functions

double unitStep (double x)
 
double sigmoid (double x)
 
double squareError (const std::vector< double > &v1, const std::vector< double > &v2)
 

Detailed Description

Utility functions for neural networks

Function Documentation

double NNetUtil::sigmoid ( double  x)

Sigmoid function

y(x) = 1 / (1 + exp(-x))

Parameters
xinput to sigmoid
Returns
output of 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

Parameters
v1first vector
v2second vector
Returns
the square error of the two vectors
double NNetUtil::unitStep ( double  x)

Unit step function

y(x) = 0 if x < 0
y(x) = 1 if x >= 0

Parameters
xinput to step function
Returns
step function of input