다음과 같은 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$$
'... > Math' 카테고리의 다른 글
[Math] Poisson Distribution (포아송분포) (1) | 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 |