def dice_coefficient(volume_1, volume_2):
with tf.variable_scope('calc_dice_coefficient'):
intersection = tf.reduce_sum(volume_1 * volume_2)
size_i1 = tf.norm(volume_1, ord=1)
size_i2 = tf.norm(volume_2, ord=1)
return 2 * intersection / (size_i1 + size_i2)
评论列表
文章目录