endernewton / iter-reason

Code for Iterative Reasoning Paper (CVPR 2018)
MIT License
265 stars 37 forks source link

Does the attention:a_0 come from the all-zero initialized memory S_0 ? #8

Closed coderSkyChen closed 6 years ago

coderSkyChen commented 6 years ago

Hi! In iter-reason/lib/nets/attend_memory.py row:154

At iteration 0, you use all-zero initialized memory S_0 to predict the confidence of f_0, while i think it's more reasonable to use roi features come from conv_base which is consistent with your paper.

I'm not sure if I understand it correctly.

endernewton commented 6 years ago

it comes from the memory, yes. the tricky thing about attention is that if you add the output from the base classifier for all the iterations, it does not matter, so in the end we implemented this way.

coderSkyChen commented 6 years ago

Thanks for your replay! But i'm still confused about "if you add the output from the base classifier for all the iterations". For example, just for the local module, given an image, if the max-iterations=3, in my opinion the final prediction score goes like: cls_score=a_0*f_0+a_1*f_1+a_2*f_2. Do you mean that f_0 will be added for all the iterations? This is what i'm confused about, could you please explain it more specific?

endernewton commented 6 years ago

I mean when predicting a_i, previously i always have both the base feature and the memory based feature as inputs. however in the current case as base feature is always the same, adding it does not change the final softmax output value. so for the iterative prediction part, it is implemented by ignoring it. iirc it does not change the result even if you have a_0 predicted from the base feature but you can try yourself and see if it makes a difference. :)

coderSkyChen commented 6 years ago

Thanks for your detailed explanation!