【发布时间】:2016-03-04 23:16:00
【问题描述】:
我正在尝试解释和理解用 Caffe .proto 编写的模型。
昨天我在here 中看到Shai 的示例'deploy.prototxt',引用如下:
layer {
name: "ip1_a"
bottom: "data_a"
top: "ip1_a"
type: "InnerProduct"
inner_product_param {
num_output: 10
}
param {
name: "ip1_w" # NOTE THIS NAME!
lr_mult: 1
}
param {
name: "ip1_b"
lr_mult: 2
}
}
layer {
name: "ip1_b"
bottom: "data_b"
top: "ip1_b"
type: "InnerProduct"
inner_product_param {
num_output: 10
}
param {
name: "ip1_w" # NOTE THIS NAME: it's the same!
lr_mult: 10 # different LR for this branch
}
param {
name: "ip1_b"
lr_mult: 20
}
}
# one layer to combine them
layer {
type: "Concat"
bottom: "ip1_a"
bottom: "ip1_b"
top: "ip1_combine"
name: "concat"
}
layer {
name: "joint_ip"
type: "InnerProduct"
bottom: "ip1_combine"
top: "joint_ip"
inner_product_param {
num_output: 30
}
}
我将此模型定义理解为:
data_a data_b
| |
| |
------- -------
| ip1_a | | ip1_b |
------- -------
| |
| |
ip1_a ip1_b
| |
| |
V V
~~~~~~~~~~~~~~~
|
|
V
-------------
| concat |
-------------
|
|
ip1_combine
|
|
-------------
| joint_ip |
-------------
|
|
joint_ip
blob ip1_a 由层ip1_a 训练,权重用ip1_w(lr:1) 初始化,偏差用ip1_b(lr:2) 初始化。
blob ip1_a 实际上是用ip1_w 初始化的新学习权重。习得性偏见没有名字。
在一些模型中,我们可以发现一些层有:
lr_mult:1
lr_mult:2
lr_mult 的第一个实例始终对应于权重,而下一个实例对应于偏差。
我上面的理解正确吗?
【问题讨论】:
标签: machine-learning neural-network deep-learning caffe