machine_vision_c.py 文件源码

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

项目:CElegansBehaviour 作者: ChristophKirst 项目源码 文件源码
def create_pair_wise_distances(x, y):
  x_shape = x.get_shape().as_list();        
  y_shape = y.get_shape().as_list();

  #expand matrices
  xx = tf.reshape(x, [x_shape[0], x_shape[1], 1]);    
  yy = tf.reshape(y, [y_shape[0], y_shape[1], 1]);
  yy = tf.transpose(yy, perm = [2,1,0]);
  xx = tf.tile(xx, [1, 1, y_shape[0]]);
  yy = tf.tile(yy, [x_shape[0], 1, 1]);
  #cc = tf.transpose(cc, perm = [2,1,0]);
  #cc = tf.tile(cc, [s_shape[0], 1, 1]);
  #ss = tf.tile(ss, [1, 1, c_shape[0]]); 

  #pairwise distances
  dist = tf.sqrt(tf.reduce_sum(tf.squared_difference(xx,yy), reduction_indices = 1));
  return dist;
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号