def eval_classificationT( self, y, p_y):
"""Calculate the error (100 - accuracy) of the DNN in the case of classification.
:type y: vector
:param y: vector (r,) of labels
:type p_y: matrix
:param p_y: matrix of the output of the network. Each raw is a vector of probailities (probablities of the classes)
"""
y_ = T.argmax(p_y, axis = 1)
# Accuracy
error = 1 - T.mean(T.eq(y_, y) * 1.)
error = error * 100.
return error
评论列表
文章目录