Autoencoder, Capsule Networks, Attention Mechanism, Deep Learning, Artificial Intelligence.
self.squash(K.batch_dot(c, dot_product, [2, 2])) if i < self.routings - 1: dot_product = K.batch_dot(outputs, dot_product, [2, 3]) return outputs def squash(self, s): squared_norm = K.sum(K.square(s), axis=-1, keepdims=True) return squared_norm / (1 + squared_norm) / K.sqrt(squared_norm +