コード例 #1
0
 def normalized_rmse(self, pred, gt_truth):
     l, r = utils.norm_idx(self.num_patches)
     assert (l is not None and r is not None)
     norm = tf.sqrt(
         tf.reduce_sum(((gt_truth[:, l, :] - gt_truth[:, r, :])**2), 1))
     return tf.reduce_sum(
         tf.sqrt(tf.reduce_sum(tf.square(pred - gt_truth), 2)),
         1) / (norm * self.num_patches)
コード例 #2
0
def _batch_normalized_error(pred, gt_truth, num_patches=73):
    l, r = utils.norm_idx(num_patches)
    assert (l is not None and r is not None)
    norm = tf.sqrt(tf.reduce_sum((tf.square(gt_truth[:, l, :] - gt_truth[:, r, :])), 1, keepdims=True))
    return tf.sqrt(tf.reduce_sum(tf.square(pred - gt_truth), 2)) / norm