mhamilton723 / STEGO

Unsupervised Semantic Segmentation by Distilling Feature Correspondences
MIT License
712 stars 143 forks source link

Confused about the spatial centering implementation #47

Closed aliasvishnu closed 1 year ago

aliasvishnu commented 2 years ago

As per my understanding, in this code for spatial centering, the operation fd -= fd.mean([3, 4], keepdim = True) should have been enough.

Can you please correct my understanding/offer intuition into this segment of code - especially why fd = fd - fd.mean() + old_mean is done? Thank you.

YBYBZhang commented 2 years ago

I have the same question !

mhamilton723 commented 1 year ago

It's been a little while but IIRC its so that you dont change the aggregate strength of the signal, aka the full mean (here old_mean). We still want positives to be more strong of an attractive force than negatives and this operation makes sure the aggregate strength remains unchanged