Exemple #1
0
 def tensor_product(x):
     a = x[0]
     b = x[1]
     y = K.batch_dot(a, b, axis=1)
     y = K.einsum('ijk, ikl->ijl', a, b)
     return y
Exemple #2
0
 def tensor_product(x):
     a = x[0]
     b = x[1]
     y = K.batch_dot(a, b, axis=1)
     y = K.einsum('ijk, ikl->ijl', a, b)
     return y
Exemple #3
0
    def call(self, x):
        output = K.einsum('ak,ijk->aij', self.kernel, x)
        if self.use_bias:
            output = K.bias_add(output, self.bias, data_format='channels_last')

        return output