复制代码def cosine_dist(self, inputs): input1, input2 = inputs a = K.abs(input1-input2) b = multiply(inputs) return K.concatenate([a, b])