You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Ashley,
In layers.py, 'def fc_caps( )' creat spatial_routing_matrix with 'spatial_routing_matrix = utl.create_routing_map(child_space=1, k=1, s=1)' , where child_space is 1, but i think it's not necessary to be 1 over this point, you know along the tensor shape alteration flow before (64, 7, 7, 8, *) ---> (64, 5, 5, 16, *) , the child_space should be 5 instead of 1.
And with child_space=1, the newly generated spatial_routing_matrix has shape (1,1), that will make the 'em_routing()' thereafter incorrect.
How do you think about that? maybe my reasoning is wrong somewhere?
Kindly regards
Jeff
The text was updated successfully, but these errors were encountered:
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.
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.
Hi Ashley,
In layers.py, 'def fc_caps( )' creat spatial_routing_matrix with 'spatial_routing_matrix = utl.create_routing_map(child_space=1, k=1, s=1)' , where child_space is 1, but i think it's not necessary to be 1 over this point, you know along the tensor shape alteration flow before (64, 7, 7, 8, *) ---> (64, 5, 5, 16, *) , the child_space should be 5 instead of 1.
And with child_space=1, the newly generated spatial_routing_matrix has shape (1,1), that will make the 'em_routing()' thereafter incorrect.
How do you think about that? maybe my reasoning is wrong somewhere?
Kindly regards
Jeff
The text was updated successfully, but these errors were encountered: