gram-ai / capsule-networks

A PyTorch implementation of the NIPS 2017 paper "Dynamic Routing Between Capsules".
https://arxiv.org/abs/1710.09829
1.73k stars 315 forks source link

Is squashing used correctly on this line? #14

Closed ghost closed 6 years ago

ghost commented 6 years ago

https://github.com/gram-ai/capsule-networks/blob/bb65115d90da2e6313feefb529f0c159bcbcaa27/capsule_network.py#L78

If I understand correctly, squashing should be applied to the feature dimension, whereas here it seems it is applied to the capsule dimension.

ghost commented 6 years ago

Sorry, the code is not wrong. I was confused by the name of variables in the first capsule layer. In fact, the capsules and the convolutional layers are not corresponding to each other.