在上一篇博文中,我们一起实现了MatchNet 的feature 部分,然后双塔顶端,分别是两层 全连接层,现在我们就按照 match net的结构,把分离的全连接 变成整体- metric network.
输入的数据是 ip1和ip1_p,我们需要把数据。
layer {
name: "ip1"
type: "InnerProduct"
bottom: "pool2"
top: "ip1"
param {
name: "ip1_w"
lr_mult: 1
}
param {
name: "ip1_b"
lr_mult: 2
}
inner_product_param {
num_output: 500
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
}
}
}
layer {
name: "ip1_p"
type: "InnerProduct"
bottom: "pool2_p"
top: "ip1_p"
param { name: "ip1_w" lr_mult: 1 }
param { name: "ip1_b" lr_mult: 2 }
inner_product_param {
num_output: 500 weight_

本文详细介绍了如何实现MatchNet的Metric Network部分,包括将全连接层整合到整体网络中,并探讨了由于原始数据集格式问题而需要自定义数据集的情况。
最低0.47元/天 解锁文章
5959





