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
  • 相关阅读:
    怎么制作html5网站页面让它适应电脑和手机的尺寸
    js面向对象 下
    认识面向对象及代码示例
    Math 对象
    js事件驱动函数
    模拟js中注册表单验证
    敏感词过滤 简单 模仿
    模仿随机验证码-简单效果
    字符串方法(函数)
    js中字符串概念
  • 原文地址:https://www.cnblogs.com/lutingting/p/5240719.html
Copyright © 2011-2022 走看看