XifengGuo / CapsNet-Keras

A Keras implementation of CapsNet in NIPS2017 paper "Dynamic Routing Between Capsules". Now test error = 0.34%.
MIT License
2.47k stars 651 forks source link

Batch dot reimplementation #107

Closed gcfengxu closed 4 years ago

XifengGuo commented 4 years ago

@gcfengxu Thank you for the effort.
But I think using sum(multiply(a, b)) to implement batch_dot is time-consuming and actually a detour. We can directly use sum(multiply(a, b)) to implement the operations needed in CapsLayer, but it was proved to be of high computational complexity, as I did in earlier commits.

Instead, I propose to replace K.batch_dot with tf.matmul, see https://github.com/XifengGuo/CapsNet-Keras/tree/tf2.2

Please check it out and continue contributing this repo.