PyTorch Hooks Explained - In-depth Tutorial

Veröffentlicht am: 25 August 2020
auf dem Kanal: Elliot Waite
35,415
1.4k

UPDATE: `register_backward_hook()` has been deprecated in favor of `register_full_backward_hook()`. You can read more about `register_full_backward_hook()` here:
https://pytorch.org/docs/stable/gener...

In this video, I explain how hooks work in PyTorch. Hooks allow you to inject code into different parts of the computational graphs (in both the forward graph and the backward graph). The four types of hooks that are available in PyTorch are:
Tensor.register_hook (https://pytorch.org/docs/stable/gener...)
Module.register_forward_pre_hook (https://pytorch.org/docs/master/gener...)
Module.register_forward_hook (https://pytorch.org/docs/master/gener...)
Module.register_backward_hook (https://pytorch.org/docs/master/gener...)

My previous video, "PyTorch Autograd Explained - In-depth Tutorial":
📼    • PyTorch Autograd Explained - In-depth...  

GitHub code examples of using hooks:
💻 https://github.com/elliotwaite/pytorc...

Join our Discord community:
💬   / discord  

Connect with me:
🐦 Twitter -   / elliotwaite  
📷 Instagram -   / elliotwaite  
👱 Facebook -   / elliotwaite  
💼 LinkedIn -   / elliotwaite  

🎵 Kazukii - Return
→   / ohthatkazuki  
→ https://open.spotify.com/artist/5d07M...
→    / officialkazuki  


Auf dieser Seite können Sie das Online-Video PyTorch Hooks Explained - In-depth Tutorial mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Elliot Waite 25 August 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 35,415 Mal angesehen und es wurde von 1.4 tausend den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!