bourdakos1 / capsule-networks

A Tensorflow implementation of Capsule Networks
MIT License
478 stars 156 forks source link

Why we need to tile the input during routing? and why we make a tile of 10 parts? #5

Open meet-minimalist opened 6 years ago

meet-minimalist commented 6 years ago

I didnt understand why we need to tile the input in routing function? Please provide some clarity.

Ref: routing function

bourdakos1 commented 6 years ago

It makes it easier to do the matrix multiplication

bourdakos1 commented 6 years ago

There are 1152 capsules There are 10 digits we are trying to predict There is one weight for each digit per capsule: (each capsule gets it own set of digit weights) So essentially 11520 weights The dimension of the weights don’t match the dimensions of the capsules

Since each capsule needs to be multiplied by 10 different digit weight we can simply tile each capsule 10 times.

So you end up with 10 of each capsule (11520) Now the dimensions match and we can safely multiply the capsules with the weights