Glossary: Computer Vision Basics
hook
Also written: register_forward_hook, register_hook
A function that PyTorch calls at a certain moment, such as when a layer runs or when a gradient is computed. Grad-CAM uses hooks to capture a layer's activations and gradients without editing the model.