yxgeee / SpCL

[NeurIPS-2020] Self-paced Contrastive Learning with Hybrid Memory for Domain Adaptive Object Re-ID.
https://yxgeee.github.io/projects/spcl
MIT License
316 stars 66 forks source link

the update of the hybrid memory #15

Closed crazydemo closed 3 years ago

crazydemo commented 3 years ago

how can i debug the hybrid memory's features. i just change the moemtumn update function to the simple ctx.features = ctx.features +1 . And when i debug the hm.py, the self.features is never changed.

yxgeee commented 3 years ago

Did you setup the code again (python setup.py install) after you change the code?

crazydemo commented 3 years ago

Did you setup the code again (python setup.py install) after you change the code?

i did not re-setup the code. But i have tried, whether to setup the code again do nothing to the debuging results. I wonder whether the memory is updated, and how can i see the updates in real time. I have treid to print the self.features in hm.py, but it is not changed.

yxgeee commented 3 years ago

Did you check the memory after loss backpropagation? Since the features in the memory would be updated when doing loss.backward().

yxgeee commented 3 years ago

Which means that, you need to print the features after the line of loss.backward() instead of in the forward() of hm.py.

crazydemo commented 3 years ago

Did you check the memory after loss backpropagation? Since the features in the memory would be updated when doing loss.backward().

it really updates when in the loss.backward(), but in the next iteration, in the forward phase, the memory is kept the same as the initialization. I am confusing that, as the backward has been done, the memory is supposed to be updated in the next iteration, but i cannot see the difference.

yxgeee commented 3 years ago

Did you print the whole memory? Only a mini-batch's samples would be updated, you need to check whether the corresponding batch has been updated.

crazydemo commented 3 years ago

I will have more trial, thank you for your time.