I found that some of activations are nearly zeros, I want to remove these calculations.
# short cut ratio
self.top_percent = 0.1
# 10% same quality
# use activation as masks
activations = self.activations
# remove useless activations by sorted mean activation , leave sub-masks
top_count = int(self.top_percent * activations.shape[1])
channel_scores = activations.mean(axis=[2, 3], keepdim=False).flatten()
top_indice = channel_scores.argsort(0,descending=True)[:top_count]
sub_masks = activations[:, top_indice] # only these will be computed
I found that some of activations are nearly zeros, I want to remove these calculations.