Caffe 中的缩放层 [英] Scale layer in Caffe

查看:21
本文介绍了Caffe 中的缩放层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看 用于深度残差网络的 Caffe prototxt 并注意到 Scale" 层的外观.

I am looking through the Caffe prototxt for deep residual networks and have noticed the appearance of a "Scale" layer.

layer {
    bottom: "res2b_branch2b"
    top: "res2b_branch2b"
    name: "scale2b_branch2b"
    type: "Scale"
    scale_param {
        bias_term: true
    }
}

但是,此层在 Caffe 层目录中不可用.有人能解释一下这个层的功能和参数的含义吗,或者指向 Caffe 的最新文档?

However, this layer is not available in the Caffe layer catalogue. Can someone explain the functionality of this layer and the meaning of the parameters or point to a an up-to-date documentation for Caffe?

推荐答案

你可以找到关于 caffe 的详细文档 这里.

You can find a detailed documentation on caffe here.

具体来说,对于 "Scale" 层,文档 读取:

Specifically, for "Scale" layer the doc reads:

计算两个输入 Blob 的乘积,后一个 Blob 的形状广播"以匹配前者的形状.相当于平铺后一个 Blob,然后计算元素乘积.
第二个输入可以省略,在这种情况下,它作为层的参数学习.

Computes a product of two input Blobs, with the shape of the latter Blob "broadcast" to match the shape of the former. Equivalent to tiling the latter Blob, then computing the elementwise product.
The second input may be omitted, in which case it's learned as a parameter of the layer.

似乎在您的情况下(单个底部"),该层学习了一个比例因子来乘以 "res2b_branch2b".此外,由于 scale_param {bias_term: true } 意味着该层不仅学习乘法缩放因子,而且学习常数项.因此,前向传递计算:

It seems like, in your case, (single "bottom"), this layer learns a scale factor to multiply "res2b_branch2b". Moreover, since scale_param { bias_term: true } means the layer learns not only a multiplicative scaling factor, but also a constant term. So, the forward pass computes:

res2b_branch2b <- res2b_branch2b * alpha + eta

在训练过程中,网络试图学习 alphaeta 的值.

During training the net tries to learn the values of alpha and eta.

这篇关于Caffe 中的缩放层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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