GithubHelp home page GithubHelp logo

Comments (2)

huanghoujing avatar huanghoujing commented on August 29, 2024 4

你好,组装batch的时候是不考虑哪些样本会组成三元组的,一个batch包含有P个人、每个人取K张图片,比如P=16,K=4,batch中有64张图片。这些图片都经过网络提取特征,得到64个特征。接下来构建三元组:(1)把每一个图片都当成anchor,总共可以选出64个三元组(其实按照排列组合可以选出很多三元组的,In defense of triplet loss这篇文章就只构建有代表性的64个三元组),(2)每个三元组的anchor选定后,positive从K-1个中选一个与anchor特征距离最远的样本,negative从P*K-K个中选一个与anchor特征距离最近的样本,这样子对这个anchor来说,选出来的positive和negative都是最困难的。这样组建了P*K个三元组,计算出P*K个triplet loss,把这些loss取平均进行反传。

数据集迭代的过程是按照person id来循环的,假设数据集有751个id,一个batch取掉了16个id,这样经过int(751/16)个batch就循环了一次(一个epoch),接下来把id的顺序打乱,进行下一轮迭代(下一个epoch)。

from person-reid-triplet-loss-baseline.

exitxingling avatar exitxingling commented on August 29, 2024

谢谢解答!!

from person-reid-triplet-loss-baseline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.