ReLU

1 개요

이미지 채널 값의 ReLU(Rectified Linear Unit) 함숫값 또는 미분값을 반환하는 알고리즘입니다.

ReLU
Graph
Fig. Plot of ReLU function.

2 알고리즘 상세 설명

Forward 모드

Source 이미지 픽셀 각 채널 값의 ReLU 함숫값을 계산하여 출력합니다.
아래의 Figure 는 [-1, 1] 범위의 float 이미지에 적용한 예시를 보여줍니다.

Source Image Destination Image
Source Image Destination Image
Fig. Source and destination images. (forward mode)

yn=ReLU(xn)y_{n} = \text{ReLU}(x_{n})

ReLU(x)={xx>00otherwise\text{ReLU}(x) = \begin{cases} x & x>0 \\ 0 & \text{otherwise} \end{cases}

Backward 모드

Source 이미지 픽셀 각 채널 값의 ReLU 미분값을 계산하여 출력합니다.
아래의 Figure 는 [-1, 1] 범위의 float 이미지에 적용한 예시를 보여줍니다.

Source Image Destination Image
Source Image Destination Image
Fig. Source and destination images. (backward mode)

yn=ReLU(xn)y_{n} = \textnormal{ReLU}'(x_{n})

ReLU(x)={1x>00otherwise\text{ReLU}'(x) = \begin{cases} 1 & x>0 \\ 0 & \text{otherwise} \end{cases}

3 파라미터 설정 및 사용 방법

Operation Mode 설정

4 예제 코드

COperationReLU relu;

CFLImage fliSourceImage;
CFLImage fliDestinationImage;

relu.SetSourceImage(fliSourceImage);
relu.SetDestinationImage(fliDestinationImage);
relu.SetOperationMode(COperationReLU::EOperationMode_Forward);

relu.Execute();
COperationReLU relu = new COperationReLU();

CFLImage fliSourceImage = new CFLImage();
CFLImage fliDestinationImage = new CFLImage();

relu.SetSourceImage(ref fliSourceImage);
relu.SetDestinationImage(ref fliDestinationImage);
relu.SetOperationMode(COperationReLU.EOperationMode.Forward);

relu.Execute();

5 기타 사항

Supported Feature

Supported Format

Overflow Method

Overflow 가 발생하지 않습니다.

6 관련 알고리즘

PReLU ELU Softplus Sigmoid Swish Mish Soft Shrinkage Hard Shrinkage