ABOUT ME

Today
Yesterday
Total
  • [Math] Entropy
    Implementation/Loss 2021. 9. 21. 08:49

    - 텍스트 모델에서의 모델 성능기준이 되는 Perplexity 개념을 접근하기 위해서 기초가 되는 Entropy 

     

    - 엔트로피 공식 

     

     

     

    - 확률 분포에 따른 엔트로피 공식 계산 예제 

    -0.5 * np.log2(0.5) - 0.5 * np.log2(0.5)
    = 1
    -0.8 * np.log2(0.8) - 0.2 * np.log2(0.2)
    = 0.7219280948873623
    eps = np.finfo(float).eps
    -1 * np.log2(1) - eps * np.log2(eps)
    = 1.1546319456101628e-14

     

    'Implementation > Loss' 카테고리의 다른 글

by eric