jwyang / JULE.torch

Torch code for our CVPR 2016 paper "Joint Unsupervised LEarning of Deep Representations and Image Clusters"
MIT License
286 stars 82 forks source link

how to calculate diff in loss layer #2

Closed xiaoyuliu closed 6 years ago

xiaoyuliu commented 8 years ago

Hi,

I tried to implement the loss layer using python you mentioned in the paper (eq(11)), however I have no idea how the diff should look like, because usually there will be three diffs for anchors/positives/negatives. Can you please provide the sample using only feats and labels as inputs?

Thanks!

jwyang commented 8 years ago

Hi, @codingsmallfish

At line 429 in train.lua, I used organize_samples() function to organize triplets given the feats and labels. The outputs are triplet and triplet index for eq(11). You can take the function organize_samples function as a reference if you plan to reimplement by python.

please let me know if you have concerns.

thanks, Jianwei

xiaoyuliu commented 8 years ago

Hi, @jwyang

Thank you pretty much!