naturomics/CapsNet-Tensorflow

Why num_outputs is mandatory?

Closed this issue · 3 comments

digitCaps = CapsLayer(num_outputs=10, vec_len=16, with_routing=True, layer_type='FC')

Why num_outputs is set in this while it will not be used?

@thibo73800 the 'num_outputs' para should be used in this line: b_IJ = tf.zeros(shape=[1, 1152, 10, 1, 1], dtype=np.float32) => b_IJ = tf.zeros(shape=[1, 1152, num_outputs, 1, 1], dtype=np.float32), which is designed for extensibility. Of course, the '1152' can also be automatically calculated (I would like to replace all of number with parameters, making the code can be reused in more scenarios)

Ok, but the meaning of num_outputs is in fact, the number of capsules in the "Fc" CapsulesLayer?

Thank for your answer.

@thibo73800 Yes, it is.