www0wwwjs1 / Matrix-Capsules-EM-Tensorflow

A Tensorflow implementation of CapsNet based on paper Matrix Capsules with EM Routing
Apache License 2.0
218 stars 83 forks source link

Initial value assigned to r. #9

Closed gyang274 closed 6 years ago

gyang274 commented 6 years ago

In capsnet_em.py em_routing():

r = tf.constant(np.ones([batch_size, caps_num_i, caps_num_c], dtype=np.float32) / 32)

should this be:

r = tf.constant(np.ones([batch_size, caps_num_i, caps_num_c], dtype=np.float32) / caps_num_c)

as in paper:

∀i, c: Ric ← 1/size(L + 1)
yhyu13 commented 6 years ago

Hi, @gyang274

Thanks for spotting a mistake! The code is fixed as you suggested.

Regards!