Google ML Bootcamp/2. Improving Deep Neural Networks(35)
-
11. Weight Initialization for Deep Networks
Vanishing or Exploding 문제를 해결할 수 있는 방법(완벽히 해결하는 것은 아니지만 굉장한 효과가 있음) - Weight Initialization randomly * np.sqrt(1/n[l-1]) - activation function이 relu인 경우 np.sqrt(2/n[l-1]) 이 더 잘 작동함. 가중치 초기 설정에 분산을 설정하는 방법인데 이가 hyperparameter 순위에 있어서 아래쪽에 속하지만 Vanishing , Exploding 문제를 해결함에 있어서는 좋은 방법이 되었다.
2023.09.10 -
10. Vanishing / Exploding Gradients
이때 W가 1에 근사하는 어느 값이라도 L이 커질수록 Exploding or Vanishing 문제가 발생함을 확인할 수 있다.
2023.09.10 -
9. Normalizaing Inputs
훈련 시간을 단축시키는 방법 : input 정규화 - 이때 train, test에 동일한 정규화 기법을 사용해야 정확하게 모델 성능을 평가할 수 있음 경험상으로는 학습 속도는 개선될 수 있어도 모델 성능에는 부정적인 영향을 끼치는것을 많이 보았다...
2023.09.10 -
8. Other Regularization Methods
**중요 : 정규화 왜함? 과적합을 피하기 위해** - 과적합을 피하는 방법으로는 Data Augumentation도 있다. - 이미지의 경우 rotation, crop등을 통해 train set을 늘릴 수도 있다. 과적합을 피하기 위한 방법 1. Dropout 2. Data Augumentation 3. Early stopping Early stop의 단점 - optimize cost function, not overfit 문제를 단독으로 풀 수 없다. - 두 가지의 문제가 존재할 때 각각 해결하여 성능을 더 높일 수 있는데 학습을 이른 시점에 종료한다면 두 가지를 단독으로 해결할 수는 없다.
2023.09.10 -
7. Understanding Dropout
keep_prob에 대한 이해 - [0,1] - 즉 해당 layer에서 unit을 유지할 비율을 의미 - 1이면 dropout이 없다는 의미 **중요 : Dropout은 정규화 기법. 정규화 기법은 과적합 방지** - 즉 과적합이 일어나지 않는다면 굳이 할 필요가 없는 기법이기도 하다. - dropout은 랜덤으로 발생하기 때문에 cost function이 잘 정의되지 않는다. 매 순간 달라지기 때문 - 따라서 loss 수렴을 확인하기 위해서는 keep_prob=1로 설정하고 수행할 것.
2023.09.10 -
6. Dropout Regularization
Dropout - L2 norm 정규화랑 비슷한 개념으로 그냥 unit을 비활성화 시키는 정규화 기법 d3.shape : a3.shape과 같은 랜덤 숫자 배정. - 이때 keep_prob과 비교 연산을 수행한다면 결과값은 0또는1로 매핑된다. a3와 element-wise 연산을 통해 일부 unit을 0으로 만들어 dropout을 수행한다. 이후 a3를 다시 keep_prob으로 나누어 Inverted dropout를 수행한다. - 이는 기존 a3에서 일부가 0으로 바뀌게 되면서 기댓값이 줄어들었으므로, propagation 시 전달되는 기댓값은 유지하기 위해 수행한다. Making predictions at test time - test 시에는 당연하게도 dropout을 사용하지 않고 모든 unit을..
2023.09.10