In the paper, there is a sentence
During training, we mask out all but the activity vector of the correct digit capsule.
so, I think it will mask all but the capsule (1x16 vector) which is match the ground-truth during training. And the code now is about testing time, it will mask all but the longest capsule (1x16 vector).
In the paper, there is a sentence
so, I think it will mask all but the capsule (1x16 vector) which is match the ground-truth during training. And the code now is about testing time, it will mask all but the longest capsule (1x16 vector).