Error in Notebook : Visualising CNN Occlusion Experiment

While doing the occlusion experiment,

  1. The heatmap was declared with size output_height and output_width but when iterating in the loop, the range was set for height and width which I think should not be the case as the heatmap was generated for output size. I experimented with this by replacing the range with an upper limit with output size and got the same heatmap. So can you verify that my assumption is right or wrong?

  2. I didn’t get the logic for evaluating the h_start, w_start, h_end, and w_end. Can you elaborate more on this?

  1. Yes, i think this should have been occ_width , occ_height. Will have to check once again for any confirmation. It’s seems unusual that you’re getting same results for both the ways, can you please share a snapshot for the cell where you modified the function?
  2. Evaluating these variables with width, height makes sense it we had :
h_end=min(occ_height, h_start+occ_size)
w_end=min(occ_width, w_start+occ_size)

I tried this with the different picture also:

And got same results:

For this,

I only changed the for loop range,

And for this,

I rewatched that portion of the video and got the intuition.

That’s fine, think you should try changing the following lines as well, and maybe then only the results will differ:

h_end=min(occ_height, h_start+occ_size)
w_end=min(occ_width, w_start+occ_size)

I changed the values and got a weird output like this:
This is the output for the dome image:

It seems something unusual, I will check this whole thing once again, and get back to you.

Yes, take your time as it’s getting messed up