本文介绍了什么是“参数"?在caffe层?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我遇到了"Parameter" caffe 层.
似乎该层将其内部参数 blob 暴露给top".

Recently I came across "Parameter" layer in caffe.
It seems like this layer exposes its internal parameter blob to "top".

这个层有什么用?
能举个例子吗?

What is this layer using for?
Can you give a usage example?

推荐答案

这一层是在 pull request 中引入的 #2079,带有以下说明:

This layer was introduced in the pull request #2079, with the following description:

该层仅包含用户定义形状的参数 blob,并将其作为单个顶部共享.

这正是您所期望的.这是在问题 #1474 的上下文中引入的,它基本上建议将参数处理为正常的底部斑点.为了说明为什么这很有用,请考虑以下示例(取自 issue #1474, by @longjon):

which is exactly what you expected. This was introduced in context of the issue #1474, which basically proposes to treat parameters like normal bottom blobs. To show why this can be useful, consider the following example (taken from issue #1474, by @longjon):

内积层计算C = A * B,其中C为顶部blob(输出),B为底部blob, 和 A 必须 是参数 blob.这是非常有限的,因为这使得无法使用内积层来乘以两个底部 blob 之间的内积,例如将两个输入矩阵相乘.问题 #1474 建议进行根本性更改:使参数独立于层.相反,将它们视为普通的底部斑点.

The inner product layer calculates C = A * B, where C is the top blob (output), B is a bottom blob, and A must be a parameter blob. This is very restrictive, as this makes it impossible to use the inner product layer for multiplying the inner product between two bottom blobs, e.g. multiplying two input matrices. The issue #1474 suggests to make a fundamental change: make parameters independent of the layer. Instead, treat them like a normal bottom blob.

作为朝着这个方向迈出的第一步,引入了Parameter.这允许您定义一个新参数,然后您可以将其输入到另一层的底部.对应 - 一种将参数作为底部 blob 输入层的方法 - 在拉取请求中提出 #2166,截至 2017 年 1 月,尚未合并.虽然这还没有合并,但你仍然可以使用 Parameter 层来定义新的可学习参数,作为底部 blob 输入其他层.

As a first step in that direction, the Parameter layer was introduced. This allows you to define a new parameter, which you can then feed into the bottom of another layer.The counterpart - a method for feeding parameters into a layer as a bottom blob - is proposed in pull request #2166, which isn't merged yet, as of Jan. 2017.Though this is not merged yet, you can still use Parameter layer to define new learnable parameters to feed into other layers as bottom blob.

这篇关于什么是“参数"?在caffe层?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 11:59