zoukankan      html  css  js  c++  java
  • caffe之(五)loss层

    在caffe中,网络的结构由prototxt文件中给出,由一些列的Layer(层)组成,常用的层如:数据加载层、卷积操作层、pooling层、非线性变换层、内积运算层、归一化层、损失计算层等;本篇主要介绍loss层

    1. loss层总述

    下面首先给出全loss层的结构设置的一个小例子(定义在.prototxt文件中) 

    layer {
      name: "loss"
      type: "SoftmaxWithLoss"  //loss fucntion的类型
      bottom: "pred"  //loss fucntion的输入数据blob,即网络的预测值lable
      bottom: "label"  //loss function的另外一个输入数据blob,即数据集的真实label
      top: "loss" //loss的输出blob,即分类器的loss 值
    }

    2. loss function类型

    粗略地讲,loss function是用来衡量估计值和真实值之间的误差情况的;在caffe中,包含了常用的loss function,目前主要有以下几种:

    【Loss drives learning by comparing an output to a target and assigning cost to minimize. The loss itself is computed by the forward pass and the gradient w.r.t. to the loss is computed by the backward pass.】

    (1)softmax:图像多类分类问题中主要就是用它

    • Layer type: SoftmaxWithLoss

    (2)Sum-of-Squares / Euclidean:主要用在线性回归中

    • Layer type: EuclideanLoss

    (3)Hinge / Margin:主要用在SVM分类器中

    • Layer type: HingeLoss

    (4)Sigmoid Cross-Entropy

    • Layer type: SigmoidCrossEntropyLoss

    (5)Infogain

    • Layer type: InfogainLoss
     参考:caffe tutorial
  • 相关阅读:
    MVC中的helper标签
    自适应网页设计(Responsive Web Design)
    网站设计的最简主义
    Windows Forms数据绑定技术
    [C#]写自己的类库
    C#数据库连接字符串
    CSS float属性
    CSS之UL
    NET教程:MVC4使用Bundling,CSS中图片路径问题
    ASP.net 中Get和Post的用法
  • 原文地址:https://www.cnblogs.com/lutingting/p/5240719.html
Copyright © 2011-2022 走看看