在上一篇博文中,我们一起实现了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: "ip