mmd_vae_eval.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:MMD-Variational-Autoencoder 作者: ShengjiaZhao 项目源码 文件源码
def compute_kernel(x, y):
    x_size = tf.shape(x)[0]
    y_size = tf.shape(y)[0]
    dim = tf.shape(x)[1]
    tiled_x = tf.tile(tf.reshape(x, tf.stack([x_size, 1, dim])), tf.stack([1, y_size, 1]))
    tiled_y = tf.tile(tf.reshape(y, tf.stack([1, y_size, dim])), tf.stack([x_size, 1, 1]))
    return tf.exp(-tf.reduce_mean(tf.square(tiled_x - tiled_y), axis=2) / tf.cast(dim, tf.float32))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号