Data & Computing情報理論University
AQAAPOntarioNSWCBSEGCE O-LevelMoECAPS

クロスエントロピー(ベルヌーイ) Calculator

真のベルヌーイ分布(p)とモデルのベルヌーイ分布(q)の間のクロスエントロピー。

Use the free calculatorCheck the variablesOpen the advanced solver
This is the free calculator preview. Advanced walkthroughs stay in the app.
Result
Ready
Cross-Entropy

Formula first

Overview

ベルヌーイ分布の交差エントロピーは、真の二値確率pと予測確率qの間の発散を定量化します。これは二値分類で使用される標準的な指標であり、予測分布が実際のターゲット分布からどれだけ異なるかに基づいてモデルを罰します。

Symbols

Variables

H(p,q) = Cross-Entropy, p = True Probability, q = Model Probability

H(p,q)
Cross-Entropy
nats
True Probability
Variable
Model Probability
Variable

Apply it well

When To Use

When to use: 結果が相互に排他的な二値分類モデルを評価する場合にこの式を適用します。これは、ロジスティック回帰モデルや二値ニューラルネットワークの訓練中に使用される主要な損失関数です。

Why it matters: この関数は分類において平均二乗誤差よりも優れており、モデルが自信を持って間違っている場合により強い勾配を提供します。これにより、勾配降下法のような最適化プロセス中の収束が速くなります。

Avoid these traps

Common Mistakes

  • 確率の代わりにパーセンテージを使用する(0.7ではなく70)。
  • ln(0)を取る(qは0から1の間でなければならない)。

One free problem

Practice Problem

機械学習モデルが画像に猫が含まれる確率を0.7 (q) と予測しました。実際の画像は確かに猫です (p = 1.0)。この予測の二値交差エントロピーをnatsで計算してください。

Hint: p = 1なので、(1-p)項はゼロになり、-ln(q)のみを計算すればよいことを意味します。

The full worked solution stays in the interactive walkthrough.

References

Sources

  1. Wikipedia: Cross-entropy
  2. Elements of Information Theory (2nd ed.) by Thomas M. Cover and Joy A. Thomas
  3. Deep Learning by Ian Goodfellow, Yoshua Bengio, and Aaron Courville
  4. Elements of Information Theory (Cover and Thomas)
  5. Cover, Thomas M., and Joy A. Thomas. Elements of Information Theory. 2nd ed. Wiley-Interscience, 2006.
  6. Goodfellow, Ian, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016.