tf.keras.losses.Dice
Вычисляет значение потери Dice между y_true и y_pred.
Наследуется от: Loss
tf.keras.losses.Dice(
reduction='sum_over_batch_size', name='dice'
)
Формула:
loss = 1 - (2 * sum(y_true * y_pred)) / (sum(y_true) + sum(y_pred))
| Аргументы | |
|---|---|
y_true | тензор истинных целевых значений. |
y_pred | тензор предсказанных целевых значений. |
| Возвращает | |
|---|---|
| Значение потери Dice. |
Методы
call
call(
y_true, y_pred
)
from_config
@classmethod
from_config(
config
)
get_config
get_config()
__call__
__call__(
y_true, y_pred, sample_weight=None
)
Вызов self как функции.
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/keras/losses/Dice