Activations and Gradient

How can we estimate both gradient and activation using the hook call back. I would like to compute their product to estimate rank of filters in the network as described in