rogertrullo / Receptive-Field-in-Pytorch

Numerical Computation of Receptive Field in Pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When input width or height is smaller than RF

hma02 opened this issue · comments

commented

Thanks for the note on calculating RF based on backprop.

I see you mentioned at the end of README.md:

with the appropiate shape for your specific network

It seems to calculate RF in this way we need to provide an image whose width and height are larger than the net's RF, which requires RF to be known. So one might need to iteratively increase the input size to find the point when RF stops increasing.

For example,

img_np=np.ones((1,1,28,56))
$ python rf.py 
analytical RF: 35
numerical RF [28, 35]

Hi @hma02, yes you are right. One way to check it’s realizing that if the RF it’s exactly the same size as the input, it probably means that you need to use a larger input.