def kernel_pred(x_data, prediction_grid):
A = tf.reshape(tf.reduce_sum(tf.square(x_data), 1), [-1, 1])
B = tf.reshape(tf.reduce_sum(tf.square(prediction_grid), 1), [-1, 1])
square_distance = tf.add(tf.subtract(A, tf.multiply(2., tf.matmul(x_data, tf.transpose(prediction_grid)))),
tf.transpose(B))
return tf.exp(tf.multiply(gamma, tf.abs(square_distance)))
评论列表
文章目录