Closed hi-zhengcheng closed 5 years ago
The given implementation does not deal with your mention condition. We found that omitting excluding step can still encourage patches to find diverse nearest neighbors. Besides, using that step does not improve such diversity further obviously but it does increase a lot computational burden. We will put that in the disclaimer.
hi-zhengcheng notifications@github.com 于2019年3月22日周五 下午7:56写道:
@shepnerd https://github.com/shepnerd Thank you for the great work. After reading the paper and code, I can not understand the following code quite well. Need your help.
When computing relative similarity between v and s:
def calc_relative_distances(self, axis=3): epsilon = 1e-5 div = tf.reduce_min(self.raw_distances, axis=axis, keep_dims=True) relative_dist = self.raw_distances / (div + epsilon) return relative_dist
The paper said: [image: Screen Shot 2019-03-22 at 04 31 44] https://user-images.githubusercontent.com/33408107/54820165-79c1f500-4c5b-11e9-895e-21abf1c0fb62.png
In my understanding:
- max(r) in paper is the div in the code.
- When s is not equal to value in div, the code is OK.
- When s is equal to the value in div, as the paper said, div should exclude this value first, then find another suitable value.
But the code didn't handle the condition when s is equal to the value in div and didn't exclude it. Is this a small bug in the code or something wrong in my understanding ?
Hope I described it clearly.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shepnerd/inpainting_gmcnn/issues/3, or mute the thread https://github.com/notifications/unsubscribe-auth/AE1PCLMwxlbVQKxTJJGxvrHHVjnLZOOHks5vZMTQgaJpZM4cDaeH .
Got it, thanks a lot.
@shepnerd Thank you for the great work. After reading the paper and code, I can not understand the following code quite well. Need your help.
When computing relative similarity between v and s:
https://github.com/shepnerd/inpainting_gmcnn/blob/fe5295ea8029e59a9cd3ae5547463cf188450229/tensorflow/net/ops.py#L330
The paper said:
In my understanding:
max(r)
in paper is thediv
in the code.s
is not equal to value indiv
, the code is OK.s
is equal to the value indiv
, as the paper said,div
should exclude this value first, then find another suitable value.But the code didn't handle the condition when
s
is equal to the value indiv
and didn't exclude it. Is this a small bug in the code or something wrong in my understanding ?Hope I described it clearly.