/pytorch-snippets

PyTorch snippets and concepts useful for learning

Primary LanguageJupyter Notebook

PyTorch Snippets

Pytorch Hooks [001]

PyTorch Hooks play a pivotal role within PyTorch, offering a flexible mechanism to examine and control intermediate activations or gradients in neural network layers during both forward and backward passes. Within this repository, you'll find a simple toy example that I created to delve deeper into forward hooks, which I extensively utilized during my master's thesis.

References

  1. https://pytorch.org/docs/stable/generated/torch.nn.modules.module.register_module_forward_hook.html