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
Following up on #79 & #90, the CAM methods should be able to process batches. With the way they are computed, here is the proposal to handle two cases:
if the model got an input_tensor with batch size = 1, then the CAM extractor can only be passed either a single integer (class index) or a list of class indices of length 1.
if the model gets a tensor with batch_size = N, then:
if the CAM extractor receives class_idx: int, it will return a tensor of shape (N, H, W) which is the class activation map for class corresponding to index = class_idx, for each element of the input batch
if the CAM extractor receives class_idx: List[int] (of size N), it will return a tensor of shape (N, H, W) where element k, along the batch axis, will be the class activation map for class corresponding to index = class_idx[k] for the k-th element of the input batch.
So far, for more complex behaviours, I cannot foresee a way to do it efficiently (without breaking the backprop).
The text was updated successfully, but these errors were encountered:
Following up on #79 & #90, the CAM methods should be able to process batches. With the way they are computed, here is the proposal to handle two cases:
class_idx: int
, it will return a tensor of shape (N, H, W) which is the class activation map for class corresponding to index = class_idx, for each element of the input batchclass_idx: List[int]
(of size N), it will return a tensor of shape (N, H, W) where element k, along the batch axis, will be the class activation map for class corresponding to index =class_idx[k]
for the k-th element of the input batch.So far, for more complex behaviours, I cannot foresee a way to do it efficiently (without breaking the backprop).
The text was updated successfully, but these errors were encountered: