本文整理汇总了Python中score.Score.score方法的典型用法代码示例。如果您正苦于以下问题:Python Score.score方法的具体用法?Python Score.score怎么用?Python Score.score使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类score.Score
的用法示例。
在下文中一共展示了Score.score方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Neural_Network
# 需要导入模块: from score import Score [as 别名]
# 或者: from score.Score import score [as 别名]
# 70% of the data is used to train the neural network
trainData, testData = D.splitData(data, 0.7)
trainX, trainY = D.loadData(trainData)
trainX, trainY = D.toMatrix(trainX, trainY)
testX, testY = D.loadData(testData)
testX, testY = D.toMatrix(testX, testY)
NN = Neural_Network()
T = Trainer(NN)
T.train(trainX, trainY)
result = NN.forward(testX)
# used to test gradient descent
# if this number is too big, then the result will be garbage
numgrad = computeNumericalGradient(NN, trainX, trainY)
grad = NN.computeGradients(trainX, trainY)
# print np.linalg.norm(grad-numgrad)/np.linalg.norm(grad+numgrad)
# print 'real data'
# print testY
# print 'result'
# print result
S = Score();
score = S.score(testY, result)
print 'score (lower is better): ', score