我是靠谱客的博主 迅速小笼包,这篇文章主要介绍神经网络loss,现在分享给大家,希望可以做个参考。

loss function

MSE

  • mean square error,即均方根误差,即

L=1Ni=1N(ypredytrue)2 L = 1 N ∑ i = 1 N ( y p r e d − y t r u e ) 2

MAE

  • mean absolute error,即平均绝对值误差,即

L=1Ni=1N|ypredytrue| L = 1 N ∑ i = 1 N | y p r e d − y t r u e |

cross entropy

  • 二分类:以logistic回归为代表

1Ni=1N[yilogpi+(1yi)log(1pi)] − 1 N ∑ i = 1 N [ y i log ⁡ p i + ( 1 − y i ) l o g ( 1 − p i ) ]

  • 多分类:以softmax loss为代表,每个样本的loss为

i=1Nyilogpi − ∑ i = 1 N y i log ⁡ p i

smooth L1 loss

  • 公式如下:

f(x)={(σx)2/2,|x|0.5/σ2,if x<1/σ2otherwise f ( x ) = { ( σ x ) 2 / 2 , if  x < 1 / σ 2 | x | − 0.5 / σ 2 , otherwise

σ σ 是scaler系数,一般设置为1。这个在bounding box regression loss中常用。

KL散度(kullback_leiber_divergence)

  • 指的是两个概率分布P和Q差别的非对称性的度量。典型情况下,P表示数据的真实分布,Q表示数据的理论分布、模型分布或P的近似分布。
  • 参考链接:https://zhuanlan.zhihu.com/p/28047686

最后

以上就是迅速小笼包最近收集整理的关于神经网络loss的全部内容,更多相关神经网络loss内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(66)

评论列表共有 0 条评论

立即
投稿
返回
顶部