AmingWu / SVD-Dictionary-Enhancement

10 stars 1 forks source link

encode centroid #2

Open Leminhbinh0209 opened 2 years ago

Leminhbinh0209 commented 2 years ago

Hi , I don't see you describe the encoding of centroid in the Eqn (4), but it is in your code, why is that, or I miss it somewhere else?

new_center = self.encode(centroid.unsqueeze(0).repeat(xs.shape[0], 1, 1).permute(0,2,1)).permute(0,2,1)
AmingWu commented 2 years ago

Thank you. In our paper, we have interpreted the encoding (bellow Eq. (4)). It is a fully-connected layer that maps P to the dictionary space.

Leminhbinh0209 commented 2 years ago

Thank you for the reply. In Eqn 4, I think \psi function is currently applied for the P, not for codebook C. Whilst in the code, the encoder is applied for both codebook C and P (in file roi_box_feature_extractors.py).

I have another question with the code in the file generalize_rcnn.py . I see that you reshape a feature tobatch_szie x 256 x n (line new_features = features[i].reshape(features[i].shape[0],256,-1)), then you apply SVD for the first instance only (?) (line u1_0, s1_0, v1_0 = torch.svd(new_features[0].double(), some=True)), why don't you apply SVD for the whole mini-batch?