naturomics / CapsNet-Tensorflow

A Tensorflow implementation of CapsNet(Capsules Net) in paper Dynamic Routing Between Capsules
Apache License 2.0
3.8k stars 1.16k forks source link

Reshape is correct? #61

Closed manuelsh closed 6 years ago

manuelsh commented 6 years ago

https://github.com/naturomics/CapsNet-Tensorflow/blob/4be551a1069e62ba8a5e7c12537c6672e3f11c6f/capsLayer.py#L78

I think this line is not preserving the following in the paper:

"Each primary capsule output sees the outputs of all 256 × 81 Conv1 units whose receptive fields overlap with the location of the center of the capsule."

i.e. we should ensure that the first capsule after the view corresponds to the pixel [0,0] of the first 8 filters, and the second with [0,1] and so on.

manuelsh commented 6 years ago

I believe the reshape is ok. No issue.