# Calculating Neural Network Error

I am confused with these two error formulas for artificial neural networks: \begin{align} \text{Error} &= {\rm target} - {\rm output} \\[7pt] \text{Mean Square Error} &= \frac{1}{2m} \sum_{i=1}^{m} (y-\hat y)^2 \end{align}

Training error and testing error are used to determine the progress of training, but I am wandering which error formula to use.

When we talk about "error" in a neural network, what does this "error" typically refer to?

//AForge
var teacher = new BackPropagationLearning(network);
//...
var error = teacher.RunEpoch(input, output);