chanyn / HKRM

Hybrid Knowledge Routed Module for Large-scale Object Detection (NerIPS2018)
104 stars 19 forks source link

Spatial (implicit) context uses a nearly-identity adjacency matrix #8

Open AruniRC opened 5 years ago

AruniRC commented 5 years ago

In the following code inside the HKRM implicit module, the Identity matrix is added num_A times to the adjacency matrix that defines a particular relation graph. Therefore, the main diagonal is numA * I, while all the other elements are lesser than 1. Even after normalization, this indicates that the main contribution to a region i would be itself, and negligible contributions from other regions j.

https://github.com/chanyn/HKRM/blob/master/lib/model/HKRM/faster_rcnn_HKRM.py#L58

for i in range(self.num_A):
    A = self._modules['compute_A{}'.format(i)](reigon_feature) + A + Iden
# Row sum to one
A = A / A.sum(1).unsqueeze(1)

If you could please elaborate the reasoning behind this design, it would be a big help. Thank you.

mandal4 commented 4 years ago

I have a same question too. I found that the adj matrix 'A' shows nearly-identity matrix after fully converge.