Capsule Networks (CapsNets) – Tutorial

Опубликовано: 27 Март 2026
на канале: Aurélien Géron
193,732
5.1k

CapsNets are a hot new architecture for neural networks, invented by Geoffrey Hinton, one of the godfathers of deep learning.

NIPS 2017 Paper:
Dynamic Routing Between Capsules,
by Sara Sabour, Nicholas Frosst, Geoffrey E. Hinton
https://arxiv.org/abs/1710.09829

The 2011 paper:
Transforming Autoencoders
by Geoffrey E. Hinton, Alex Krizhevsky and Sida D. Wang
https://goo.gl/ARSWM6

A 2018 paper submitted to ICLR 2018 (under review):
Matrix capsules with EM routing
https://openreview.net/pdf?id=HJWLfGWRb

CapsNet implementations:
My TensorFlow implementation: https://github.com/ageron/handson-ml/...
It is presented in my video:    • How to implement CapsNets using TensorFlow  
Keras w/ TensorFlow backend: https://github.com/XifengGuo/CapsNet-...
TensorFlow: https://github.com/naturomics/CapsNet...
PyTorch: https://github.com/gram-ai/capsule-ne...

Book:
Hands-On Machine with Scikit-Learn and TensorFlow
O'Reilly, 2017
Amazon: https://goo.gl/IoWYKD

Github: https://github.com/ageron
Twitter:   / aureliengeron  

Slides:
https://www.slideshare.net/aurelienge...

Errata:
At 15:47, in the margin loss equation, the max should be squared, but not the norm: L_k = T_k max(0, m+ − ||v_k||)² + λ (1 − T_k) max(0, ||v_k|| − m−)². Therefore, at 16:08, the network should output a vector whose length (not squared length) is longer than 0.9 for digits that are present, or smaller than 0.1 for digits that are absent. I'll clarify this point in my next video on implementing Capsule Networks.