Data & Computing정보 이론University
AQAAPOntarioNSWCBSEGCE O-LevelMoECAPS
크로스 엔트로피 (베르누이) Calculator
참 베르누이(p)와 모델 베르누이(q) 사이의 크로스 엔트로피.
Use the free calculatorCheck the variablesOpen the advanced solver
Formula first
Overview
베르누이 분포에 대한 교차 엔트로피는 실제 이진 확률 p와 예측 확률 q 사이의 발산을 정량화합니다. 이는 이진 분류에서 모델의 예측 분포가 실제 목표 분포와 얼마나 다른지에 따라 패널티를 부과하는 표준 측정항목입니다.
Symbols
Variables
H(p,q) = Cross-Entropy, p = True Probability, q = Model Probability
Apply it well
When To Use
When to use: 결과가 상호 배타적인 이진 분류 모델을 평가할 때 이 방정식을 적용하십시오. 이는 로지스틱 회귀 모델 및 이진 신경망 훈련 중에 사용되는 기본 손실 함수입니다.
Why it matters: 이 함수는 분류에서 평균 제곱 오차보다 우수한데, 모델이 자신 있게 틀렸을 때 더 강한 기울기를 제공하기 때문입니다. 이는 경사 하강법과 같은 최적화 과정에서 더 빠른 수렴을 가져옵니다.
Avoid these traps
Common Mistakes
- 확률 대신 백분율을 사용하는 경우 (70이 아닌 0.7).
- 0의 ln을 취하는 경우 (q는 엄격히 0과 1 사이여야 함).
One free problem
Practice Problem
머신러닝 모델이 이미지에 고양이가 있을 확률을 0.7(q)로 예측합니다. 실제 이미지는 실제로 고양이입니다(p = 1.0). 이 예측에 대한 이진 교차 엔트로피를 nats 단위로 계산하십시오.
Hint: p = 1이므로 (1-p) 항이 0이 되어 -ln(q)만 계산하면 됩니다.
The full worked solution stays in the interactive walkthrough.
References
Sources
- Wikipedia: Cross-entropy
- Elements of Information Theory (2nd ed.) by Thomas M. Cover and Joy A. Thomas
- Deep Learning by Ian Goodfellow, Yoshua Bengio, and Aaron Courville
- Elements of Information Theory (Cover and Thomas)
- Cover, Thomas M., and Joy A. Thomas. Elements of Information Theory. 2nd ed. Wiley-Interscience, 2006.
- Goodfellow, Ian, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016.