Comments (2)
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.
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)
- cost_j_h = (beta_v + 0.5*tf.log(var_j)) ? HOT 3
- Routing by agreement with Transformer-based for NMT HOT 2
- pip requirements need to be fixed
- failed to run cuBLAS routine cublasGemmBatchedEx issue HOT 3
- The impact of validation set selected from test set HOT 2
- Great realization, great work!! HOT 1
- Try to continue to train from a checkpoint HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matrix-capsules-with-em-routing.