ReLU(Rectified Linear Unit)

  • activation 중 하나로 대표적으로 많이 사용됨.
  • Does not saturate(for )
  • Leads to fast convergence
  • Computationally efficient

Problems

  • No learning for → dead/dying ReLU
    • downstream gradient가 0(input이 0 이하일 때,)
    • often initialize with pos. bias ()
  • Outputs are not zero-centered → introduces bias after the layer
    • sigmoid와 그 gradient는 항상 positive이기 때문에 model wight의 bias
    • 라 할 때, =
    • 모든 gradient는 동일한 부호를 가짐.

다음과 같이 구현.

ReLU

def relu(x: float) -> float:
	return np.maximum(0, x)
  • 단점들 보안을 위해 Leaky ReLU 등이 있음.

How can we calculate non-differentiable function (like ReLU)?