W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
tf.nn.log_poisson_loss(
targets,
log_input,
compute_full_loss=False,
name=None
)
定義在:tensorflow/python/ops/nn_impl.py.
請(qǐng)參閱指南:神經(jīng)網(wǎng)絡(luò)>損失操作
在給定log_input的情況下計(jì)算log Poisson損失.
在假設(shè)目標(biāo)具有Poisson分布的情況下,給出預(yù)測(cè)與目標(biāo)之間的對(duì)數(shù)似然損失(log-likelihood loss).
注意:默認(rèn)情況下,這不是確切的損失,而是損失減去常數(shù)項(xiàng)[log(z!)].這對(duì)優(yōu)化沒有影響,但是相對(duì)損失比較不能很好地發(fā)揮作用.
要計(jì)算log階乘項(xiàng)的近似值,請(qǐng)指定compute_full_loss = True以啟用Stirling的近似值.
為簡(jiǎn)潔起見,讓c = log(x) = log_input,z = targets.log Poisson損失是:
-log(exp(-x) * (x^z) / z!)
= -log(exp(-x) * (x^z)) + log(z!)
~ -log(exp(-x)) - log(x^z) [+ z * log(z) - z + 0.5 * log(2 * pi * z)]
[ Note the second term is the Stirling's Approximation for log(z!).
It is invariant to x and does not affect optimization, though
important for correct relative loss comparisons. It is only
computed when compute_full_loss == True. ]
= x - z * log(x) [+ z * log(z) - z + 0.5 * log(2 * pi * z)]
= exp(c) - z * c [+ z * log(z) - z + 0.5 * log(2 * pi * z)]
參數(shù):
返回:
一個(gè)與log_input(有分量邏輯損失)具有相同shape的Tensor.
可能引發(fā)的異常:
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: