caffe_SCIR--预测函数改为对称性

改进预测函数,使其具有对称性

原来的预测函数是:
这里写图片描述

其不满足对称性,下面将其改进为具有对称性的预测函数:
这里写图片描述

二元组和三元组模型的损失函数与原来类似:
这里写图片描述

这里写图片描述

方案一:二元组修改doublet_loss
bottom: “flat_fc1” #f(xi)
bottom: “flat_fc2” #f(xj)
bottom: “fc3b” #Wg(xi,xj)
bottom: “fc3bb” #Wg(xj,xi)
bottom: “pairlabel_ci” #随机选取batchsize=300
top: “loss3”
三元组修改 triplet_loss(与二元组类似)
实验结果:loss处于0.5~2区间,不收敛.

方案二:修改linear_contrastive_loss
bottom: “sum_e_f_f”
bottom:”pairlabel_ci”
top:”loss4”
利用caffe自带函数求欧氏距离:euclidean_distance
bottom: “flat_fc1” #f(xi)
bottom: “flat_fc2” #f(xj)
top:”euclidean_distance”
利用elwise求两次加和:
elwise_layer1:
bottom: “fc3b” #Wg(xi,xj)
bottom: “fc3bb” #Wg(xj,xi)
top:”sum_f_f”
elwise_layer2:
bottom: “sum_f_f”
bottom: “euclidean_distance”
top:”sum_e_f_f”

实验结果:

test_net结果(correct):
二元组singleshot:0.092243
三元组singleshot: 0.33753

原代码:
二元组singleshot:0.3543
三元组没测,但应该大于二元组

分析:test_net 还存在问题

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值