Giter Club home page Giter Club logo

Comments (4)

naturomics avatar naturomics commented on May 27, 2024

Did you mean the routing in this class? The last layers of papers dynamics routing between capsules and matrix capsule with EM routing are both a fully connected layer but use a different routing algorithm (dynamics vs. EM routing). This class wrap them up and easily choose one of them by the parameter 'routing_method'. Sorry just noticed that the doc didn't mention this.

from capslayer.

mukeshmithrakumar avatar mukeshmithrakumar commented on May 27, 2024

Thank you for getting back to me @naturomics .
What I meant is, the convcaps2 layer is fully connected to the final class capsules layer but in the code you linked (

def dense(inputs, activation,
) on line 86, you are calling routing again in the class caps layer, that is where I was confused.
To be more specific, in the paper:
"When connecting the last convolutional capsule layer to the final layer we do not want to throw
away information about the location of the convolutional capsules but we also want to make use of
the fact that all capsules of the same type are extracting the same entity at different positions. We
therefore share the transformation matrices between different positions of the same capsule type and
add the scaled coordinate (row, column) of the center of the receptive field of each capsule to the first
two elements of the right-hand column of its vote matrix. We refer to this technique as Coordinate
Addition."
please correct me if I am wrong, so I understood it as just coordinate addition and no routing inside class capsules

from capslayer.

naturomics avatar naturomics commented on May 27, 2024

OK, I got your point. As we know the final layer is a capsules layer, not a 'normal' layer. The routing is the main difference between them, if not doing routing, it turns out to be a normal layer:

consider a fully connected capsule layer: $Z=(P \odot W) X=W' X$, that $W'=P\odot W$ stands for element-wise multiply. What capsules do is optimizing P=h(X, WX), here h() for a clustering-like EM algorithm. If no routing, P is fixed and then $W'=P \odot W$ will act as what a linear transformation z=wx do in the normal neural network.

from capslayer.

mukeshmithrakumar avatar mukeshmithrakumar commented on May 27, 2024

@naturomics thanks a lot man, it makes sense

from capslayer.

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.