[Math] Error Function

2023. 9. 24. 22:03·.../Math
728x90
728x90

다음과 같은 integral expression으로 정의되는 Transcendental Function의 하나임.

$$\text{erf}(x)=\dfrac{2}{\sqrt{\pi}}\int^x_0 e^{-\tau^2}d \tau$$

  • $\text{erf}(x)$는 standard normal distribution의 cumulative distribution function과 동일함.
  • 정확히는 Gauss function의 적분은 $\text{erf}(x)$의 상수배(1/2 배)임.

ML 등의 분야의 GeLU activation function 유도에서 사용된다.

https://dsaint31.me/mkdocs_site/ML/ch09/act_silu/#gaussian-error-linear-unit-gelu

 

BME228

Sigmoid Linear Unit (SiLU) : from GELU to MiSH Smooth function과 ReLU의 장점을 조합 한 ELU를 넘어서는 성능을 보이며 보다 복잡한 task의 ANN에 많이 사용되는 activation function Swish라는 이름으로도 잘 알려짐. SiLU

dsaint31.me


CDF of Standard Normal Distribution

다음 수식은 이를 잘 보여줌.

 

Standard Normal Distribution $\mathcal{N}(0,1)$의 probability density function은 다음과 같음.
$$\text{pdf of }\mathcal{N}(\mu,\sigma)=\dfrac{1}{\sqrt{2\pi}\sigma}e^{-\dfrac{(x-\mu)^2}{2\sigma^2}}$$

 

이에 대한 cumulative distribution function $\text{cdf}$는 다음과 같음.
$$\begin{aligned}\text{cdf}(x)&=\dfrac{1}{\sqrt{2\pi}}\int^x_{-\infty} \text{exp}\left[-\dfrac{\tau^2}{2}\right]d\tau\\&=\dfrac{1}{\sqrt{2\pi}}\int^x_{-\infty}\text{exp}\left[-\left(\dfrac{\tau}{\sqrt{2}}\right)^2\right]d\tau\\&=\dfrac{\sqrt{2}}{\sqrt{2\pi}}\int^x_{-\infty}e^{-t^2}dt\\&=\dfrac{1}{\sqrt{2\pi}} \int^x_{-\infty}e^{-t^2}dt\\ &=\dfrac{1}{\sqrt{2\pi}} \left( \int^x_{0}e^{-t^2}dt+ \int^0_{-\infty}e^{-t^2}dt \right)\\&=\dfrac{1}{2}\text{erf}(x)+\dfrac{1}{2}\end{aligned}$$

  • cdf of standard normal distribution 은 $\dfrac{1}{2}\text{erf}(x)$이며,
  • 이는 -1에서 1의 range를 가지는 sigmoid function 으로
  • hyperbolic tangent와 매우 유사한 모양을 가짐.


특징

$\text{erf}(x)$의 특징은 다음과 같음.

  • $|\text{erf}(x)| \le 1$
  • 피적분함수가 even function이므로 이를 부정적분하고 $C$(or 적분상수)=0으로 한 $\text{erf}(x)$는 odd function임 : $\text{erf}(x)=-\text{erf}(-x)$
  • $\underset{x\to 0}{\lim}\text{erf}(x)=0,\underset{x\to \infty}{\lim}\text{erf}(x)=1,\underset{x\to -\infty}{\lim}\text{erf}(x)=-1$
  • 모든 complex number $c$와 그의 conjugate complex $c^{*}$에 대해, $\text{erf}(c^{*})=\text{erf}^{*}(c)$.

또 정의식의 양변을 정리하고 적분하면 다음이 성립

$$
\dfrac{d}{dx}\left[\dfrac{\sqrt{\pi}}{2}\text{erf}(x)\right]=e^{-x^2}\\ \int e^{-x^2}dx=\dfrac{\sqrt{\pi}}{2}\text{erf}(x)+C
$$

이 때문에 다음이 성립함.
$$\int^{\infty}_{x=-\infty} e^{-x^2} dx =\sqrt{\pi}$$

이에 대한 증명은 다음과 같음.
$$\begin{aligned} \int^\infty_{x=-\infty}e^{-x^2}dx&=\dfrac{\sqrt{\pi}}{2}\left\{\text{erf}(\infty)-\text{erf}(-\infty)\right\}\\ &=\dfrac{\sqrt{\pi}}{2}2\\ &=\sqrt{\pi}\end{aligned}$$

 

다른 Sigmoid functions들과 비교

2022.12.28 - [.../Math] - [Math] Sigmoid function

 

[Math] Sigmoid function

S자형 곡선을 갖는 함수. (대표적인 예가 logistic function이나 sigmoid는 다음과 같이 여러 종류가 있음) Artificial Neural Network의 Artificial Neron의 Activation function으로 초창기에 많이 사용되었음. Logistic dist

dsaint31.tistory.com


Complementary Error Function

참고로 complementary error function $\text{erfc}(x)$은 다음과 같음.

$$\text{erfc}(x)=\dfrac{2}{\sqrt{\pi}} \int_x^\infty e^{-\tau^2}d\tau$$

$\text{erf}(x)$와 $\text{erfc}(x)$는 다음을 만족.

$$\text{erf}(x)+\text{erfc}(x)=1$$

728x90

'... > Math' 카테고리의 다른 글

[Math] Poisson Distribution (포아송분포)  (2) 2023.10.25
[Math] Derivative of Logistic Function  (0) 2023.09.25
[Math] The Cauchy-Schwarz Inequality  (0) 2023.08.22
[Math] Bernoulli Distribution (베르누이 분포)  (0) 2023.08.17
[DL] Softsign : tanh의 유사품  (0) 2023.08.15
'.../Math' 카테고리의 다른 글
  • [Math] Poisson Distribution (포아송분포)
  • [Math] Derivative of Logistic Function
  • [Math] The Cauchy-Schwarz Inequality
  • [Math] Bernoulli Distribution (베르누이 분포)
dsaint31x
dsaint31x
    반응형
    250x250
  • dsaint31x
    Dsaint31's blog
    dsaint31x
  • 전체
    오늘
    어제
    • 분류 전체보기 (787)
      • Private Life (15)
      • Programming (55)
        • DIP (116)
        • ML (35)
      • Computer (120)
        • CE (54)
        • ETC (33)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (9)
      • ... (368)
        • Signals and Systems (115)
        • Math (176)
        • Linear Algebra (33)
        • Physics (43)
        • 인성세미나 (1)
      • 정리필요. (61)
        • 의료기기의 이해 (6)
        • PET, MRI and so on. (7)
        • PET Study 2009 (1)
        • 방사선 장해방호 (5)
        • 방사선 생물학 (3)
        • 방사선 계측 (9)
        • 기타 방사능관련 (3)
        • 고시 (9)
        • 정리 (18)
      • RI (0)
      • 원자력,방사능 관련법 (2)
  • 블로그 메뉴

    • Math
    • Programming
    • SS
    • DIP
  • 링크

    • Convex Optimization For All
  • 공지사항

    • Test
    • PET Study 2009
    • 기타 방사능관련.
  • 인기 글

  • 태그

    linear algebra
    math
    function
    fourier transform
    Probability
    Python
    signals_and_systems
    numpy
    Optimization
    Programming
    random
    opencv
    SS
    ML
    cv2
    Term
    인허가제도
    Vector
    SIGNAL
    signal_and_system
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
dsaint31x
[Math] Error Function
상단으로

티스토리툴바