Git Product home page Git Product logo

Comments (6)

Atcold avatar Atcold commented on August 17, 2024 2

From the paper, section 4, last paragraph, you have that

Our implementation [...] minimize the sum of the margin losses in Eq. 4.

(Install this extension to view LaTeX on GitHub.)

$L_k = T_k \max(0, m^+ - ||v_k||)^2 + λ (1 - T_k) \max(0, ||v_k|| - m^-)^2$

So, as you can see, you're supposed to use $||v_k||$, which is classes = (x ** 2).sum(dim=-1) ** 0.5.

from capsule-networks.

Atcold avatar Atcold commented on August 17, 2024 1
  • That's why I put there the link to the wrong line.
  • The point is not that "there is no need" but "it's plain wrong".
  • Okay, let me see.

from capsule-networks.

InnovArul avatar InnovArul commented on August 17, 2024

Though each capsules norm is a probability [0-1], the capsules will be fighting within themselves to send the info to higher level capsules (based on their correlation with the output of the higher level capsules). Hence, there is a softmax layer.

from capsule-networks.

Atcold avatar Atcold commented on August 17, 2024

That's not how Capsules work...

from capsule-networks.

InnovArul avatar InnovArul commented on August 17, 2024

Maybe if you could write your understanding about capsules or point out the lines in the paper, it will be helpful to discuss and learn I guess. Anyway, I will let the code owner to clarify your doubts.

In my understanding, more the correlation between primary capsule's output to digit capsule's output, the higher the bond between them. Hence, it's a kind of attention mechanism between primary capsules and digit capsules, which necessitates the need for a softmax (based on correlation).

from capsule-networks.

InnovArul avatar InnovArul commented on August 17, 2024

Oh I see. My bad. I didn't see which softmax you are mentioning:)

I think you are right. There is no need for softmax (since the vector's magnitude emulates probability). Thanks for elaborating it.

By the way, I have noticed some more deviations in the implementation with respect to paper. Please check if you find time. I'm not sure if my interpretation is correct.

#23

from capsule-networks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.