小编オンイ*_*イコウ的帖子

如何在 Keras 中使用 Hausdorff 度量?

我想使用 Hausdorff Distance 作为训练的度量,但我刚刚找到了 Weighted_Hausdorff_loss并将其用作医学图像分割的度量。

import math
import numpy as np
import tensorflow as tf
from sklearn.utils.extmath import cartesian

resized_height = 192  
resized_width  = 192
max_dist = math.sqrt(resized_height**2 + resized_width**2)
n_pixels = resized_height * resized_width
all_img_locations = tf.convert_to_tensor(cartesian([np.arange(resized_height), np.arange(resized_width)]),
                                                   tf.float32)
batch_size = 1

def tf_repeat(tensor, repeats):
    """
    Args:
    input: A Tensor. 1-D or higher.
    repeats: A list. Number of repeat for each dimension, length must be the same as the number of dimensions in input
    Returns:
    
    A Tensor. …
Run Code Online (Sandbox Code Playgroud)

python metrics medical keras tensorflow

5
推荐指数
1
解决办法
2387
查看次数

标签 统计

keras ×1

medical ×1

metrics ×1

python ×1

tensorflow ×1