如何解释“损失"?和“准确性"用于机器学习模型 [英] How to interpret "loss" and "accuracy" for a machine learning model

本文介绍了如何解释“损失"?和“准确性"用于机器学习模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用Theano或Tensorflow训练我的神经网络时,它们将在每个时期报告一个称为损失"的变量.

When I trained my neural network with Theano or Tensorflow, they will report a variable called "loss" per epoch.

我应该如何解释该变量?更高的损失是好是坏,这对我的神经网络的最终性能(准确性)意味着什么?

How should I interpret this variable? Higher loss is better or worse, or what does it mean for the final performance (accuracy) of my neural network?

推荐答案

损失越低,模型越好(除非模型过度适合训练数据).损失是根据训练验证计算的,其互操作性是模型在这两套模型上的表现.与准确性不同,损失不是百分比.它是对训练或验证集中每个示例所犯错误的总和.

The lower the loss, the better a model (unless the model has over-fitted to the training data). The loss is calculated on training and validation and its interperation is how well the model is doing for these two sets. Unlike accuracy, loss is not a percentage. It is a summation of the errors made for each example in training or validation sets.

对于神经网络,损失通常为对数可能性为负残差平方和分别用于分类和回归.然后自然而然地,学习模型的主要目标是通过使用不同的优化方法(例如神经网络的反向传播)来更改权重向量值,从而相对于模型的参数来减少(最小化)损失函数的值.

In the case of neural networks, the loss is usually negative log-likelihood and residual sum of squares for classification and regression respectively. Then naturally, the main objective in a learning model is to reduce (minimize) the loss function's value with respect to the model's parameters by changing the weight vector values through different optimization methods, such as backpropagation in neural networks.

损失值表示在每次优化迭代后某个模型的表现好坏.理想情况下,可以期望在每次或多次迭代后减少损失.

Loss value implies how well or poorly a certain model behaves after each iteration of optimization. Ideally, one would expect the reduction of loss after each, or several, iteration(s).

通常在学习并固定了模型参数并且没有进行学习之后,确定模型的准确性.然后,在与真实目标进行比较之后,将测试样本输入模型,并记录模型产生的错误数(零一损失).然后计算错误分类的百分比.

The accuracy of a model is usually determined after the model parameters are learned and fixed and no learning is taking place. Then the test samples are fed to the model and the number of mistakes (zero-one loss) the model makes are recorded, after comparison to the true targets. Then the percentage of misclassification is calculated.

例如,如果测试样本的数量为1000,并且模型正确分类了952个样本,则模型的准确性为95.2%.

For example, if the number of test samples is 1000 and model classifies 952 of those correctly, then the model's accuracy is 95.2%.

在降低损失值的同时还有些微妙之处.例如,您可能会遇到过度拟合的问题,其中模型存储"了训练示例,并且对测试集无效.如果您没有使用常规化,也会发生过度拟合一个非常复杂的模型(自由参数W的数量很大)或数据点N的数量很低.

There are also some subtleties while reducing the loss value. For instance, you may run into the problem of over-fitting in which the model "memorizes" the training examples and becomes kind of ineffective for the test set. Over-fitting also occurs in cases where you do not employ a regularization, you have a very complex model (the number of free parameters W is large) or the number of data points N is very low.

这篇关于如何解释“损失"?和“准确性"用于机器学习模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆