NTMC-Community / MatchZoo

Facilitating the design, comparison and sharing of deep text matching models.
Apache License 2.0
3.83k stars 899 forks source link

input_dpool_index for match_pyramid #743

Closed Decalogue closed 5 years ago

Decalogue commented 5 years ago

Hi! How to build input_dpool_index for match_pyramid? Thanks

inputs = [input_left, input_right, input_dpool_index]

Decalogue commented 5 years ago

Thank you so much!

pl8787 commented 5 years ago

You can reference the code dynamic_pooling.py.

uduse commented 5 years ago

I hope things are working well for you now. I’ll go ahead and close this issue, but I’m happy to continue further discussion whenever needed.

weibobo2015 commented 4 years ago

I have read the code dynamic_pooling.py, but i can not understand the meaning why we need to build the dpool index. Could you explain the meaning?

pl8787 commented 4 years ago

@weibobo2015 You can find some explanations here.

pl8787 commented 4 years ago

@weibobo2015 We also can use tf.image.crop_and_resize mentioned in #671 .

weibobo2015 commented 4 years ago

@weibobo2015 You can find some explanations here.

Thank you very much. So i think the purpose of this padding(or expanding?) is to keep the real info for pooling, otherwise, some real info will be discarded ? Am i right?

weibobo2015 commented 4 years ago

@pl8787

pl8787 commented 4 years ago

@weibobo2015 Yes

weibobo2015 commented 4 years ago

@pl8787 Thank you!

weibobo2015 commented 4 years ago

@pl8787 after i have read something about tf.image.crop_and_resize (ROI pooling or ROI align), there is another question. Can i use this tf.image.crop_and_resize to export the dpool_size directly instead of exporting as [max_len_a, max_len_b] and doing dynamic pooling to dpool size?

pl8787 commented 4 years ago

@weibobo2015 Yes, you can use that function.

weibobo2015 commented 4 years ago

@pl8787 👌,thank you. I'll have a try.

weibobo2015 commented 4 years ago

@pl8787 after i test the function tf.image.crop_and_resize, i find that we need to resize to [max_len_a, max_len_b] and do dynamic pooling. In addition, the sampling method in tf.image.crop_and_resize should be "nearest" rather than "bilinear" which is the default one. I think the reason is that the "nearest" sampling doesn't change the origin info, just expand.