TensorFlow training evaluation
Suppose you are dealing with a classification problem you can simply define 

def error_rate_classification(p, t):
    return np.mean(p != t)


where p and t stand for predictions and targets resp.

If you deal with a regression problem the you should modify a bit this function. For example :

def error_rate_regression(p, t):
    return np.mean(np.abs(p-t) &lt; 1e-2) # the criteria is not general


Note that for regression problem assessing the accuracy of the prediction is not as simple as it is in classification problem

Edit

In regression case, you can use the R2 regression standard metrics. Suppose yi is the ground truth value of the i-th element of your test (or validation) set and f(xi) is your i-th input prediction. The R2 is then

R2 = 1 - sum( (yi - f(xi))**2 )  / sum( (yi - y_mean)**2 )

where y_mean is the mean of the ground truth values of the test ( or validation) test.  You can find other examples in the scikit-learn regression metrics here