Giter Site home page Giter Site logo

Comments (2)

ashleygritzman avatar ashleygritzman commented on June 2, 2024

Hi Jeff,

Thanks for your question.

The spatial_routing_map is used to determine which child capsules vote for which parent capsules. The layer fc_caps() refers to a fully connected capsule layer, which means that all the child capsules feed to the parent capsules. We achieve this by flattening the child capsules along their spatial dimension, so considering an example with a batch size of 1, we would go from (1, 7, 7, 8, ?) to (1, 778, ?) [batch_size, child_space * child_space * child_caps, ?]. In other words, we now have one long vector of capsules, instead of a cube of capsules. So for this reason it is correct to have a spatial_routing_matrix of (1,1), which effectively means that no spatial routing occurs in this layer.

You can contract this to the convolutional capsule layer conv_caps(), where we do have spatial routing of capsules.

Hope this helps :-)

So

from matrix-capsules-with-em-routing.

itxiud2015 avatar itxiud2015 commented on June 2, 2024

Hi Ashley,

Thanks for your clearly explanation :)

I tried 'spatial_routing_matrix = utl.create_routing_map(child_space=5, k=5, s=1)', this result in a 'spatial_routing_matrix' of shape [25, 1]. It function well and the test accuracy is slightly more than 90% after 65 epoch training, which is comparable with that of setting utl.create_routing_map(child_space=1, k=1, s=1) at my workstation.

Best regards
Jeff

from matrix-capsules-with-em-routing.

Related Issues (8)

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.