naturomics / CapsNet-Tensorflow

A Tensorflow implementation of CapsNet(Capsules Net) in paper Dynamic Routing Between Capsules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reshape is correct?

manuelsh opened this issue · comments

capsules = tf.reshape(capsules, (cfg.batch_size, -1, self.vec_len, 1))

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.

I believe the reshape is ok. No issue.