swuxyj / DeepHash-pytorch

Implementation of Some Deep Hash Algorithms, Including DPSH、DSH、DHN、HashNet、DSDH、DTSH、DFH、GreedyHash、CSQ.
MIT License
495 stars 116 forks source link

How to speed up the loss computation in DTSH #31

Open ssqiao opened 2 years ago

ssqiao commented 2 years ago

Hi, swuxyj. Nice work for this community. It is noted that the training loss of DTSH contains a for loop which is somewhat time-consuming. Is there any change to speed up this op? It seems that the for loop can be parallelized.

swuxyj commented 2 years ago

Hi, swuxyj. Nice work for this community. It is noted that the training loss of DTSH contains a for loop which is somewhat time-consuming. Is there any change to speed up this op? It seems that the for loop can be parallelized.

可以参考其他人的实现,目前这个版本已经是我能想到的最优的方式了