DL&ML/concept

ReLU가 Non-linear인 이유?

식피두 2021. 4. 14. 12:29

ReLU는 0 이상에 대해서는 어쨌든 Linear 텀으로 구성되어 있는데 왜 Non-linear일까?

 

리니어 레이어를 아무리 쌓아도

sigmoid 나 tanh 처럼 중간에 공간을 왜곡(non-linear transform) 시키는 액티베이션이 없으면

결국 하나의 리니어 레이어랑 같은 결과라고 들었는데..

W1 * W2 * ... Wn = Wx

 

 

Neural Networks, Manifolds, and Topology -- colah's blog

Neural Networks, Manifolds, and Topology Posted on April 6, 2014 topology, neural networks, deep learning, manifold hypothesis Recently, there’s been a great deal of excitement and interest in deep neural networks because they’ve achi

colah.github.io

심지어 ReLU로 들어가는 입력이 운이 나빠 모두 양수라면

결과는 그대로 양수가 되고, 이렇게 되었을 때도 non-linear라고 할 수 있는가? 궁금했다.

 

아래 글에서 그 힌트를 얻었다.

 

Why is ReLU non-linear?

ReLU doesn’t look very non-linear, but actually it can

medium.com

 

ReLU는 max(0, x)이다

즉, ReLU(x) = 0, x <= 0

 

만약 얘를 평행이동 시킨다면?

ReLU(x-c) = 0, x <= c

가 된다.

 

그러면 새로운 함수를 정의해보자.

g(x) = ReLU(x) + ReLU(x-c) 은 어떤 모양일까?

 

https://medium.com/@maximlopin/why-is-relu-non-linear-aa46d2bad518

위와 같이 평행 이동된 ReLU 텀에 의한 직선이 시작 되기 전에는

ReLU(x)에 의한 직선이고, 시작 된 후엔 x 가 2번 누적되어 기울기가 가파른 직선으로 바뀌게 된다.

 

이런식으로 ReLU 함수의 평행이동(shift)을 통해 직선의 조합으로 선이 꺾이게 된다.

만약 여기에 양수 혹은 음수의 계수(coefficient)까지 붙여서 조합한다면?

 

더욱 다양한 모양(기울기, 꺾이는 지점)의 함수를 만들 수 있게 된다!! 

 

 

'DL&ML > concept' 카테고리의 다른 글

ML General 잡질문/답변 (기술면접)  (3) 2021.05.14
ArcFace Loss  (1) 2021.04.25
Seq2Seq & Beam Search  (0) 2021.04.14
Classification에서 CrossEntropy를 Loss 함수로 쓰는 이유?  (0) 2021.04.13
Posterior, Likelihood, Prior  (0) 2021.04.12