DagnyT / hardnet

Hardnet descriptor model - "Working hard to know your neighbor's margins: Local descriptor learning loss"
MIT License
514 stars 100 forks source link

Waht's the meaning of this line? #25

Closed yunyundong closed 6 years ago

yunyundong commented 6 years ago

labels = torch.cat([labels,datasets[i][1]])+torch.max(labels)+1

Seemingly, assume that length of datasets[0][1] and dataset[1][1] is n1, and n2 respectively and (n1<n2). So, datasets[0][1][:n1]==datasets[1][1][:n1], but they are not the positive pairs. Is it right? the original line is a bug ? @ducha-aiki @DagnyT @spongezhang

DagnyT commented 6 years ago

labels = torch.cat([labels, datasets[i][1]+torch.max(labels)+1]

It is written in such way to shift label indices, in every dataset you expect to have labels: [0, n1], so in concat function labels from new dataset have to start from (n1+1).

yunyundong commented 6 years ago

How can I point to the newest version? what's the address? Thank you very much.

DagnyT commented 6 years ago

Thank you, yes, it was a bug in TotalDataLoader. Please, check the update.