You could register a forward hook to the layer you would like to get the activations from.
Have a look at this example.
Another approach would be to modify the forward
method and return the desired activation.
You could register a forward hook to the layer you would like to get the activations from.
Have a look at this example.
Another approach would be to modify the forward
method and return the desired activation.