損失函數

損失函數#

binary_cross_entropy(inputs, targets[, ...])

計算二元交叉熵損失。

cosine_similarity_loss(x1, x2[, axis, eps, ...])

計算兩個輸入的餘弦相似度。

cross_entropy(logits, targets[, weights, ...])

計算交叉熵損失。

gaussian_nll_loss(inputs, targets, vars[, ...])

計算高斯分佈的負對數似然損失。

hinge_loss(inputs, targets[, reduction])

計算輸入與目標之間的 hinge 損失。

huber_loss(inputs, targets[, delta, reduction])

計算輸入與目標之間的 Huber 損失。

kl_div_loss(inputs, targets[, axis, reduction])

計算 Kullback-Leibler 散度損失。

l1_loss(predictions, targets[, reduction])

計算 L1 損失。

log_cosh_loss(inputs, targets[, reduction])

計算輸入與目標之間的 log cosh 損失。

margin_ranking_loss(inputs1, inputs2, targets)

給定輸入 \(x_1\)\(x_2\) 與標籤 :math:`y`(包含 1 或 -1),計算 margin ranking 損失。

mse_loss(predictions, targets[, reduction])

計算均方誤差損失。

nll_loss(inputs, targets[, axis, reduction])

計算負對數似然損失。

smooth_l1_loss(predictions, targets[, beta, ...])

計算 smooth L1 損失。

triplet_loss(anchors, positives, negatives)

計算一組 anchor、positive 與 negative 樣本的 triplet 損失。