gcdn icon indicating copy to clipboard operation
gcdn copied to clipboard

Why precompute mask for local neighborhood?

Open tonyckc opened this issue 6 years ago • 4 comments

I interest your work but have two questions in 'main.py'. First, why precompute masks for local neighborhood? Second, why leverage this manner to precompute the mask?
I'm a fresher for GCN. Thank you.

tonyckc avatar Dec 04 '19 01:12 tonyckc

The mask is used to exclude the local pixel from the nearest neighbor search. Since the local pixels are already used in the local 2D convolution we don't want to also use them in the nonlocal aggregation. The mask is constructed to be multiplied times the pairwise distance matrix D computed in the layers and sets the distances of the local pixels to zero so that we know that they will always be the first ones when we sort by distance and we can exclude them.

diegovalsesia avatar Dec 04 '19 07:12 diegovalsesia

Thank you so much. By the way, I think the precomputed mask matrix is similar to the adjacent matrix because the dimension of the matrix is N*N. Is it right?

tonyckc avatar Dec 05 '19 01:12 tonyckc

Yes, it is.

diegovalsesia avatar Dec 05 '19 12:12 diegovalsesia

Thank you. I see.

tonyckc avatar Dec 05 '19 12:12 tonyckc