You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to use the occlusion_heatmap() function in visualize.py to drastically improve my prediction performance. However, for a 45x90px CMYK image this takes roughly 2s. Considering that I have a couple of thousand images in my test set this is not really practical. So is there a way to improve the function's performance?
I'm not too familiar with numpy, but I assume that one could vectorize the nested for-loop?
for i in range(s0): for j in range(s1):
The text was updated successfully, but these errors were encountered:
I haven't used occlusion_heatmap() too much. I assume you're running the code on the GPU? You could try to profile it, or just sprinkle some print(time() - t0) over the code to understand better where time is spent.
Vectorizing the nested for-loop would not help since the slow part - the call to predict_proba - is already outside the inner loop. The problem is that for each image, you have 45x90 predictions, so I would expect the function call to be approximately as slow as calling predict_proba on 4050 samples (if not, please report).
What could be done? I see two solutions:
Don't predict for all images - I at least just look at a couple of them to get a feel.
Don't use occlusion_heatmap but instead propagate the error back on the image; this does not provide the same information, but it might still help and at least it should be much faster.
I'd like to use the
occlusion_heatmap()
function invisualize.py
to drastically improve my prediction performance. However, for a 45x90px CMYK image this takes roughly 2s. Considering that I have a couple of thousand images in my test set this is not really practical. So is there a way to improve the function's performance?I'm not too familiar with numpy, but I assume that one could vectorize the nested
for
-loop?for i in range(s0): for j in range(s1):
The text was updated successfully, but these errors were encountered: