pytorch-grad-cam icon indicating copy to clipboard operation
pytorch-grad-cam copied to clipboard

GuidedBackpropReLUModel cannot use batches

Open sammlapp opened this issue 1 year ago • 0 comments

GuidedBackpropReLUModel always uses a batch size of 1, this is hard-coded into the implementation eg here:

https://github.com/jacobgil/pytorch-grad-cam/blob/2183a9cbc1bd5fc1d8e134b4f3318c3b6db5671f/pytorch_grad_cam/guided_backprop.py#L89

Will the Guided Backprop be broken by batching? I could see how batching might ruin guided backprop, but I'm not sure if that's true or if this one-sample-per-batch implementation is just for simplicity. If batch size > 1 is not possible, please feel free to close this issue. If it is possible, consider this a feature request. Thanks!

sammlapp avatar Mar 17 '23 14:03 sammlapp