Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The mask operation is different between training and testing? #6

Open
AlexHex7 opened this issue Nov 10, 2017 · 3 comments
Open

The mask operation is different between training and testing? #6

AlexHex7 opened this issue Nov 10, 2017 · 3 comments

Comments

@AlexHex7
Copy link

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).

@timomernick
Copy link
Owner

Sorry, I don't quite understand this. Can you elaborate?

@AlexHex7
Copy link
Author

First, I'm not sure whether it is right.

In my opinion, the code of reconstruction_loss does is that choose the longest capsule, and then mask all other 9 capsules. I think this is in testing period.
For the training period, what should be done is that choose the capsule which is stand for the input digit, and mask all other 9 capsules. For example, if the input digit is 0, then for the digitcaps (10 x 16), the first capsule whose length is stand for the probability of digit 0's existing should be chosen. And the other 9 capsule which are stand for digit 1 to 9 should be mask.

But the code does not has the operation of training period.

@timomernick
Copy link
Owner

Oh, I think I see. At train time I am using the longest capsule and masking the others, but maybe I should be using the capsule corresponding to the digit from the training sample. I hope to look into this soon, as I don't understand the difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants