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

Confusion about the softmax #1

Open
Zeming-LI-Andy opened this issue Mar 8, 2023 · 0 comments
Open

Confusion about the softmax #1

Zeming-LI-Andy opened this issue Mar 8, 2023 · 0 comments

Comments

@Zeming-LI-Andy
Copy link

softmax

Dear Sir or Madam,

In your codes, the input x is [batch size, digitCap size, primaryCap size, 1, digital_capslen].

softmaxed_output = F.softmax(transposed_input.contiguous().view(-1, transposed_input.size(-1)))

I am confused why you only keep the 'primaryCap size' dimension and flatten the other dimensions including the 'batch size' dimension, at last, do the softmax operation on the zero dimension.

In the normal CapsuleNetwork algorithm, I think we just need to transpose the dimension 1 and dimension 2 of x, and then do torch.nn.functional.softmax on the 'digitCap size' dimension.

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

1 participant