가중치 초기화의 중요성
가중치 초기화는 딥러닝 모델이 학습을 시작할 때의 출발점을(초기 값) 의미하며, 이 값들이 모델의 학습 및 minimum cost 수렴 동작에 영향을 미칩니다.
만약 모든 가중치를 0으로 초기화하면 역전파 과정에서 모든 뉴런이 동일한 기울기(gradient)를 가지게 되어, 네트워크가 대칭성 문제에 빠지고 학습이 어려워집니다. 또한, 초기 가중치가 너무 크거나 작으면 기울기(gradient)가 너무 커지거나 작아져서 기울기(gradient) 폭주나 소실 문제가 발생할 수 있습니다.
Zero Initialization
Constant Initialization
Random Initialization
He initialization and Xavier initialzation
※ see [DNN] Vanishing and exploding gradients first.
For relu: W[l] = np.random.randn(shape) np.sqrt(2/n^[l-1]) < He
For tanh: W[l] = np.random.randn(shape) np.sqrt(1/n^[l-1]) < Xavier initialization
there are other methods as well.