naturomics / CapsNet-Tensorflow

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

Should we squash in the PrimaryCaps layer? #3

Closed junfanlin closed 6 years ago

junfanlin commented 6 years ago

Hi, Sorry to interrupt you again. I feel exicting when I see your work proceeding. I here realize that you do squashing operation in PrimaryCaps layer, which I don't see the reason. The paper uses squashing during routing process, but there is no routing process between Conv1 and PrimaryCaps. So I wonder is it reasonable to put squashing operation in PrimaryCaps layer? Expecting your reply! Thanks in advance.

naturomics commented 6 years ago

@junfanlin Yesterday I've pointed out this question at 知乎. At the 3rd paragraph of Sec 4, it says:

One can see PrimaryCapsules as a Convolution layer with Eq. 1 as its block non-linearity

I'm sure the PrimaryCaps layer is squashed. But my question is: dose the paper do non-linearity activation like ReLU in the PrimaryCaps layer(this line) at the same time? I don't know, but we can simply modify this tow line: code 1 and code 2 to do an experiment to see which is better. I will note this question in the code. Thank you.

junfanlin commented 6 years ago

Thank you very much! I think I missunderstood this part, but now it's corrected. Thanks again!