Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correlation layer is not defined correctly #3

Open
essaanas1 opened this issue Oct 23, 2017 · 2 comments
Open

Correlation layer is not defined correctly #3

essaanas1 opened this issue Oct 23, 2017 · 2 comments

Comments

@essaanas1
Copy link

Hi,
I am trying to implement this repository but I see that is a huge discripancy with the reported result on the paper. The result I am getting using this code provide bad result compared the the result reported in the paper. I believe the correlation layer is note defind correctly as below:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
def correlation_map( x, y, max_disp ):
corr_tensors = []
for i in range(-max_disp, 0, 1):
shifted = tf.pad(tf.slice(y, [0, 0, -i, 0], [-1]*4), [[0, 0], [0, 0], [-i, 0], [0, 0]], "CONSTANT")
corr = tf.reduce_mean(tf.multiply(shifted, y), axis=3)
corr_tensors.append(corr)
for i in range(max_disp + 1):
shifted = tf.pad(tf.slice(y, [0]*4, [-1, -1, y.shape[2].value - i, -1]), [[0, 0], [0, 0], [0, i], [0, 0]], "CONSTANT")
corr = tf.reduce_mean(tf.multiply(shifted, y), axis=3)
corr_tensors.append(corr)
return tf.transpose(tf.stack(corr_tensors),perm=[1,2,3,0])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I see that the x input is ignored while the y input is running over twice!
Could you please clarify this issue because I believe that this is the reason behind this discrepancy.

With best regards,

Essa Anas
Ph.D student

@essaanas1 essaanas1 changed the title Correlation layer note defined correctly Correlation layer not defined correctly Oct 23, 2017
@essaanas1 essaanas1 changed the title Correlation layer not defined correctly Correlation layer is not defined correctly Oct 23, 2017
@umbraclet16
Copy link

Why does the slow version have better result than the fast version?

@bryanyzhu
Copy link

@essaanas1 @umbraclet16 @fedor-chervinskii Any update on the corr1d layer? I searched online, this is the only repo with corr1d layer implementation. So for the native tensorflow version(slow), is it correct to use now? Thank you very much.

I think from your reported results, you already get better results than original paper, 2.28 compared to 2.37. Correct me if I am wrong.

I also don't understand why there is a huge gap between fast and slow version. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants