Soft Shrinkage

1 개요

이미지 채널 값의 Soft Shrinkage 함숫값 또는 미분값을 반환하는 알고리즘입니다.

Soft Shrinkage
Graph
Fig. Plot of Soft Shrinkage function.

2 알고리즘 상세 설명

Forward 모드

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

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

yn=Fλ(xn)y_{n} = F_{\lambda}(x_{n})

Fλ(x)={xλx>λ0xλx+λx<λF_{\lambda}(x) = \begin{cases} x - \lambda & x > \lambda \\ 0 & |x| \le \lambda \\ x + \lambda & x < -\lambda \\ \end{cases}

Backward 모드

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

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

yn=Fλ(xn)y_{n} = F_{\lambda}'(x_{n})

Fλ(x)={1x>λ0otherwiseF_{\lambda}'(x) = \begin{cases} 1 & |x| > \lambda \\ 0 & \text{otherwise} \end{cases}

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

Operation Mode 설정

Lambda 설정

4 예제 코드

COperationSoftShrinkage sshr;

CFLImage fliSourceImage;
CFLImage fliDestinationImage;

sshr.SetSourceImage(fliSourceImage);
sshr.SetDestinationImage(fliDestinationImage);
sshr.SetOperationMode(COperationSoftShrinkage::EOperationMode_Forward);
sshr.SetLambda(0.2);

sshr.Execute();
COperationSoftShrinkage sshr = new COperationSoftShrinkage();

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

sshr.SetSourceImage(ref fliSourceImage);
sshr.SetDestinationImage(ref fliDestinationImage);
sshr.SetOperationMode(COperationSoftShrinkage.EOperationMode.Forward);
sshr.SetLambda(0.2);

sshr.Execute();

5 기타 사항

Supported Feature

Supported Format

Overflow Method

Overflow 가 발생하지 않습니다.

6 관련 알고리즘

ReLU PReLU ELU Softplus Sigmoid Swish Mish Hard Shrinkage