diegovalsesia / gcdn

Deep Graph-Convolutional Image Denoising
MIT License
93 stars 27 forks source link

Why precompute mask for local neighborhood? #3

Open tonyckc opened 4 years ago

tonyckc commented 4 years ago

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.

diegovalsesia commented 4 years ago

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.

tonyckc commented 4 years ago

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?

diegovalsesia commented 4 years ago

Yes, it is.

tonyckc commented 4 years ago

Thank you. I see.