-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ony have anchor and pos_sample #26
Comments
我记得当初也被 inputs, labels, pos, pos_labels = data # anchor、batch中类别索引列表、正例、正例类别索引列表
...
pos = pos.view(4 * opt.batchsize, c, h, w) # 正例样本[5维->4维]
# copy pos 4times 复制四次,并使四个索引连续排布.eg:[213,213,213,213,132,132,132,132...]
pos_labels = pos_labels.repeat(4).reshape(4, opt.batchsize) # [4, b]
pos_labels = pos_labels.transpose(0, 1).reshape(4 * opt.batchsize) # [4*b] 它的含义是一个批次所有图片的类别标签×4 |
非常感谢同学帮我解答,但是我还是不明白,code中对tripletfolder.py中anchor、pos、neg进行了定义:
但在__getitem__中仅使用了pos_sample,没有neg_sample呐
此外,在forward内,就仅有 想请教同学这是为啥呐,code中到底哪个位置使用了neg_sample, 或者给出了neg_sample的索引呐? |
我记得没有任何位置用上 |
正负样本不应该分别对应anchor同身份和不同身份的行人嘛?计算loss时,这个code内正负样本选择的都是同身份中的行人呐?
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for your contribution!
In this code, I only found utilize the anchor and pos_sample as follows:
and in the forward as follows:
I cannot understand
neg_labels = pos_labels
, In the paper, neg_lable should decribe as neg_lable !=pos_label.Please help, Thx
The text was updated successfully, but these errors were encountered: