SlideShare a Scribd company logo
1 of 52
Feb 12, 2018 Page 1/52
Normalization
in Deep Neural Network
홍동균, 조경재
한양대학교
Feb 12, 2018 Page 2/52
Contents
• Batch normalization (ICML 2015)
• Layer normalization (NIPS 2016)
• Weight normalization (NIPS 2016)
• Batch renormalization (NIPS 2017)
• Self-Normalizing Neural Networks (NIPS 2017)
Feb 12, 2018 Page 3/52
Batch Normalization
Feb 12, 2018 Page 4/52
Background
• Neural network 학습 과정에서 sigmoid를 사용했을 경우
– Saturation problem: Gradient가 0에 가까운 saturation 영역에 도달하는 경우
학습이 제대로 되지 않는 문제
– 특히 network가 deep할 수록 이전 layer들의 parameter 값 변경이 현재 layer
input 값을 크게 변경하여 saturation 영역으로 도달할 가능성을 더 높게 함
𝑤𝑥 + 𝑏
𝒙
<
𝑤𝑥 + 𝑏
Feb 12, 2018 Page 5/52
Motivation
• Saturation problem을 완화하는 기존 방안
– Careful parameter initialization
– Small learning rate
– Non-saturating nonlinearities (ReLu 등)의 사용
• 그러나 논문에서는 좀 더 근본적으로 saturation
problem을 완화하여 학습 속도를 향상시키고자 함
𝑤𝑥 + 𝑏
ReLu
𝑥
Feb 12, 2018 Page 6/52
Internal Covariate Shift
• 학습 과정에서 각 layer input의 distribution이 이전 layer parameter
변화에 따라 계속해서 달라짐
• 각 layer input의 distribution을 normalize한다면 Internal covariate
shift 문제를 완화하고, 학습 속도를 빠르게 할 수 있다고 주장
Feb 12, 2018 Page 7/52
Batch Normalization Transform (1/3)
• Input의 각 차원이 독립적이라고 가정하여, 각 차원 별로 normalize 함
• 전체 훈련 데이터 대신 mini-batch 단위로 normalize 함
• BN transform은 미분 가능하도록 network에 포함되어 있음
– Input distributions이 internal covariate shift 문제를 겪지 않는 방향으로 학습
될 수 있도록
Feb 12, 2018 Page 8/52
Batch Normalization Transform (2/3)
• Input의 각 차원이 독립적이라고 가정하여, 각 차원 별로 normalize 함
– 이 가정을 통해서 covariance matrix를 계산할 필요 없이, 해당 차원의
스칼라 값만으로 normalize 가능함 -> 계산량 감소
– 이 때, 위 가정이 layer의 표현력을 제한할 수 있기 때문에, (입력에 의해
sigmoid 값이 linear한 영역에만 머무르는 문제) 추가적인 transformation을
사용함
Feb 12, 2018 Page 9/52
Batch Normalization Transform (3/3)
• 전체 훈련 데이터 대신 현재 mini-batch에 대해서 normalize 함
Feb 12, 2018 Page 10/52
Batch Normalization Inference
• Inference 과정에서는 training에서와 다르게 단일 input에 대해
output를 얻어야 함
– 학습 과정에서 평균과 분산의 moving average를 계산해 두고, 이를
inference 과정의 normalization에서 이용함
Training Inference
Feb 12, 2018 Page 11/52
Batch Normalization enables
higher learning rates
• Deep neural network에서 learning rate를 크게 하면 gradient
exploding 문제를 겪을 수 있음
– Large learning rate -> increase the scale of parameters -> gradient
explosion
• Batch normalization에서는 이를 방지
Feb 12, 2018 Page 12/52
Batch normalization 장점
• Internal covariate shift 문제를 완화 함
• Deep neural network의 학습 속도를 향상 시킴
– Learning rate 값을 크게 할 수 있음
• Large-scale image recognition에서 뛰어난 성능을 보임
Feb 12, 2018 Page 13/52
Experiments (1/2)
BN reduces internal covariate shift
85th %ile
15th %ile
50th %ile
• 실험 환경
– MNIST: 3 FC hidden layers + softmax, 100 activations per hidden layer
– (b), (c): Distribution of inputs to a sigmoid(last layer), evolving over 100k steps
• 실험 결과
– (a)에서 BN을 사용한 경우 학습 수렴 속도와 test 정확도의 향상을 확인 함
– (b)에 비해 (c)에서 BN을 사용함으로써 layer의 input distribution이 안정화
되었음을 보임 (=internal covariate shift 문제를 완화)
Feb 12, 2018 Page 14/52
Experiments (2/2)
ImageNet Classification
• 실험 환경
– Inception: deep convolutional ReLU model
– 각 convolutional layer에 BN을 적용하였음
• 실험 결과: BN의 효과로 학습 속도, 정확도가 향상 됨
– 큰 learning rate 사용, drop out 제거 등의 hyper-parameter 수정을 통해
학습 속도를 크게 향상 시킴 (BN-x5: 최대 약 15배)
– ReLu 대신 sigmoid를 사용하여도 학습이 제대로 됨 (BN-x5-Sigmoid)
ü Sigmoid를 사용한 inception 모델의 경우에는 매우 낮은 정확도(0.1%)를 갖음
Feb 12, 2018 Page 15/52
Conclusion
• Batch normalization은 internal covariate shift 문제를 완화하여 학습 속
도를 향상 시켜주었음
• Batch normalization의 단점
– Mini-batch에 의존적인 normalization 방식
ü Layer normalization (NIPS 2016)
ü Weight normalization (NIPS 2016)
– Training과 test에서의 normalization 방식이 다름
ü Batch renormalization (NIPS 2017)
– Deep feed-forward network에서는 효과적이지 않음
ü Self-normalizing neural network (NIPS 2017)
Feb 12, 2018 Page 16/52
Layer & Weight Normalization
Feb 12, 2018 Page 17/52
Background
• Batch norm의 단점: Mini-batch에 의존적인 normalization
– Recurrent model에서 적합하지 않음
– Mini-batch size가 작을 경우 불안정한 학습의 결과
• 위 단점을 해소하기 위해 mini-batch에 의존적이지 않은 normalization
방법 제안
– Layer norm
ü Mini-batch와 독립적으로, 각 layer의 input을 normalization하는 방법 제안
– Weight norm
ü Neural network weight vectors의 re-parameterization 방법 제안
Feb 12, 2018 Page 18/52
Batch normalization in recurrent model
• Input sequence의 각 time-step 마다, mini-batch의 평균과 분산을 계산
– Training 데이터에 없거나 드물게 등장한 time-step에 대해 계산한 평균과
분산은 신뢰성이 낮음
Mini-batch
Test
?
Time-step
Feb 12, 2018 Page 19/52
Layer normalization (1/2)
• Input sequence의 각 time-step 마다, mini-batch와 독립적으로 평균과
분산을 계산하여 normalization
– Mini-batch에 대한 의존성이 없음
– Training과 test 과정에서의 normalize 방식이 동일
Mini-batch
Test
Feb 12, 2018 Page 20/52
Layer normalization (2/2)
• 현재 layer의 모든 input activation feature들에 대하여 평균과 분산을
계산하여 normalize
• 𝐠, 𝒃: gain, bias parameter
– BN에서 𝛾, 𝛽와 같은 기능
𝑾 𝒉𝒉
𝒉 𝒕/𝟏
𝑾 𝒙𝒉𝒙 𝒕
𝒉 𝒕
𝒂 𝟏
𝒕
𝒂 𝟑
𝒕
𝒂 𝟐
𝒕
𝒇()
𝒉 𝟑
𝒕𝒉 𝟐
𝒕
𝒉 𝟏
𝒕
𝑾 𝒉𝒚
Feb 12, 2018 Page 21/52
Layer norm Experiments (1/2)
Question-answering task with recurrent model
• LN을 적용하여 수렴 속도를 빠르게 하고, validation error를 더 낮출 수 있었음
– 기존 모델 (LSTM 기반 attentive reader model)에 적용 전후 결과 비교 [Teaching machines to read
and comprehend, NIPS 2015]
– 기존 모델에 Batch norm을 적용한 연구와의 비교 [Recurrent Batch Normalization, ICLR 2017]
Feb 12, 2018 Page 22/52
Layer norm Experiments (2/2)
Permutation invariant MNIST
• FFN 기반의 분류 모델을 batch-size를 다르게 하여 실험
– LN이 BN을 적용했을 때 보다 수렴 속도가 빠르고, batch-size 변화에 robust 함
Batch-size가 작아졌을 때 불안정한
test error를 보임
Feb 12, 2018 Page 23/52
Weight normalization (1/3)
• Reparameterization of weight vectors in neural network
– Weight vector의 길이 (𝑔) 와 방향 (𝐯/| 𝐯 |) 을 분리 함
ü 𝑔: scalar parameter, 𝒗: parameter vector
– SGD 학습 과정에서 위의 파라미터들이 각각 학습 됨
– Mini-batch와 독립적인 방식
Feb 12, 2018 Page 24/52
Weight normalization (2/3)
• Gradients of weight vector
• Weight normalization의 장점: Learning rate 값에 대하여 robust 함
– 큰 값의 learning rate로 인해 학습 과정에서 | v | 가 계속해서 커지더라도,
gradient의 scale factor(
>
| ? |
)가 점차 감소하여 effective learning rate는
감소함
ü Large learning rate -> fast decay
ü Small learning rate -> slow decay
Feb 12, 2018 Page 25/52
Weight normalization (3/3)
• Data-dependent parameter initialization
– Weight normalization은 parameter initialization에 robust 하지 않으므로
적절한 initialization 방법이 필요함
1. Random initialization v	
ü 논문에서는 평균 0, 표준 편차 0.05인 정규 분포 사용
2. Compute	𝜇[𝑡], 𝜎[𝑡] (t =
FGH
| F |
)
ü 𝜇[𝑡], 𝜎[𝑡]는 하나의 mini-batch에 대하여 계산함
3. Data-dependent initialization 𝑔 ←
>
J[L]
, 𝑏 ←
/	N[L]
J[L]
4. Calculate output 𝐲 = 𝜙
Q
| F |
v G x + 𝑏 = 𝜙
L	/	N L
J L
BN와 유사한 방식
(BN이 잘 동작하는 상황에서 적용 가능)
Feb 12, 2018 Page 26/52
Weight norm Experiments (1/2)
Supervised classification
• WN의 결과는 BN과 비슷한 수렴 속도, test error를 보여줌
• Weight norm + Mean-only batch normalization
– Weight norm 방법은 batch norm의 regularize 효과가 더해졌을 때 test
error를 더 낮출 수 있었음
Feb 12, 2018 Page 27/52
Weight norm Experiments (2/2)
Recurrent & Generative Model
• Parameterization의 변경 만으로 recurrent model, generative model
에서 효과가 있음을 보임
– 수렴 속도가 빠르고, better optimum으로 수렴
– Noise-sensitive한 특성이 있는 generative model에도 효과적
DRAW (recurrent generative model) on MNIST Convolutional VAE (generative model) on CIFAR-10
Feb 12, 2018 Page 28/52
Batch norm, Weight norm, Layer norm
Batch norm Weight norm Layer norm
방식 - Mini-batch 단위로
normalization
- Weight vector의
reparameterization
- 하나의 layer의 모든 input
feature에 대하여 normalization
장점 - CNN 모델에서 좋은 분류 성
능을 보임
- Mini-batch에 의존적이지 않음
(Recurrent model, generative model에서 좋은 성능)
단점 - Mini-batch에 의존적으로
recurrent model, noise-sensitive
model에서는 잘 동작하지 않음
- Mini-batch size가 작은 경우
불안정
- Training과 test에서의 계산 방
법이 다름
- Parameter initialization에 robust
하지 않음
- CNN model에 대해서는 BN을
적용하는 것이 더 좋음
Feb 12, 2018 Page 29/52
Batch normalization의 단점
• Mini-batch에 의존적인 normalization 방식
– Layer normalization (NIPS 2016)
– Weight normalization (NIPS 2016)
• Training과 test에서의 normalization 방식이 다름
– Batch renormalization (NIPS 2017)
• Deep feed-forward network에서는 효과적이지 않음
– Self-normalizing neural network (NIPS 2017)
Feb 12, 2018 Page 30/52
Batch Renormalization
Feb 12, 2018 Page 31/52
Background
• Batch normalization은 deep network를 학습하는데 필수적으로 사용되고 있음
– 각 layer들의 input distribution을 normalize함으로써 학습이 안정화되고, 정확도 손실 없이
학습 속도가 크게 개선되었음
• Batch normalization의 limitation
– Training 단계에서의 normalize 방법이 inference단계에서와 다름
– Training 단계에서 학습된 parameter들은 inference 단계에서 효과가 제대로 발휘 되지
않을 수 있음
ü Small mini-batch, Non-i.i.d mini-batch에서는 문제가 더 악화됨
≠
Training: mini-batch wise Inference: moving average
Feb 12, 2018 Page 32/52
Small mini-batches
• Mini-batch의 size가 작은 경우를 의미함
• 문제점
– Small mini-batch를 기반으로 계산된 mean, variance가 reliable하지 않음
– 특히, layer의 depth가 깊은 경우, 계산되는 mean, variance의 reliability가 더 낮아질수
있음
– Inference 단계에서는 (전체 training set이 고려된) moving average를 기반으로
normalize를 하기 때문에 문제가 더 악화됨
Training step: mini-batch size 4 Inference step: moving average
2 3 1 4 2 3 1 4 … 5 1 2
≠
Feb 12, 2018 Page 33/52
Non i.i.d mini-batches
• 특정 distribution을 갖는 data들로 mini-batch들이 구성됨
– 전체 training set이 갖는 distribution과는 다른 특정 distribution
– 학습 과정에서 mini-batch 의존적으로 normalize를 수행하기 때문에 모델이 전체
training set의 general한 distribution이 아닌 각 mini-batch의 distribution에
overfit되는 문제가 발생함
• Inference 단계에서는 moving average를 기반으로 normalize를 수행하기
때문에 inference의 결과가 좋지 않음
각 mini-batch들의 distribution training data distribution
≠
Feb 12, 2018 Page 34/52
Batch Renormalization
• Training
① Batch norm과 동일하게 mini-batch 기반으로 mean, variance를 계산
② 해당 mean, variance로 normalize된 값을 moving average를 기반으로 보정 (renorm)
ü Moving average가 반영된 r & d parameter를 사용함
=>전체 training set을 고려하여 mini-batch 기반으로 normalize된 값을 보정 (mini-batch
의존성을 해결)
• Inference
③ Moving average를 기반으로 normalize
ü Training normalize ≈ Inference normalize
①
③
②
Feb 12, 2018 Page 35/52
Batch Renormalization
• Batch Norm의 장점을 보존
– Parameter initialization insensitive
– Higher learning rate이 가능함
ü Batch norm처럼 학습 속도가 빨라짐
• Batch Norm의 단점을 보완
– Moving average를 기반으로 train 단계에서 mini-batch 단위로 normalize된 값을 보정
ü Mini-batch에 의존적이지 않게 됨
– Training, Inference 단계의 normalize 방법의 차이가 완화됨
=>small mini-batch, non-i.i.d mini-batch의 경우에도 잘 동작함
Feb 12, 2018 Page 36/52
Experiment: ImageNet Classification
• 실험 세팅
– Inception: deep convolutional ReLU model
– 각 convolutional layer에 BN, BRN을 적용하였음
• Small mini-batch에 대한 정확도 실험
– (a): Mini-batch size 32
ü Mini-batch 의존성이 해결되면서, 정확도 조금 개선됨
– (b): Mini-batch size 4
ü Batch norm small mini-batch에 대해서 취약함을 보임
ü Batch renorm이 stable함을 보임
ü Batch Renorm은 더 빠르게 learning이 수행됨
§ (130k에서 수렴)
Feb 12, 2018 Page 37/52
Non-i.i.d mini-batch에 대한 정확도 실험
• Batchnorm이 non-i.i.d mini-batch에 대해선 취약함을 보임
– Training step이 증가하면서 정확도가 낮아지는 경향을 보임
ü 78.3% -> 67.0%로 정확도가 낮아짐
– Non-i.i.d mini-batch의 training accuracy 또한 낮은 정확도를 보임
ü 78.3% > 72.8%
• Non-i.i.d로 test set을 구성하고 𝜇U, 𝜎U로 normalize를 수행할 경우
정확도가 조금 높아짐
– Non-i.i.d mini-batch로 학습한 model은 overfit되어 학습된 것을 보임
ü 67% -> 76.5%
• BatchRenorm의 경우 non-i.i.d mini-batch에 대해서 stable함
– Training step이 증가하면서 높은 정확도로 수렴함
ü 67.0% -> 78.6%로 정확도가 크게 개선됨
Feb 12, 2018 Page 38/52
Conclusion
• Batch normalization 특정 case에 취약함을 보임
– Small mini-batch, Non-i.i.d mini-batch
– Training과 Inference의 normalize가 다르기 때문에 위 문제가 더 악화됨
• Batch norm의 문제를 개선하는 Batch Renormalization을 제안하였음
– Mini-batch 기반으로 계산된 mean & variance에 대해서 moving average를 고려하여
보정함으로 써 mini-batch 의존적인 문제를 해결하였음
– Training과 inference의 normalize에 대한 차이를 완화하여 small mini-batch, Non-i.i.d
mini-batch에 stable함
– 실험을 통해 효용성을 입증하였음
Feb 12, 2018 Page 39/52
Self-Normalizing Neural Networks
Feb 12, 2018 Page 40/52
Background
• Deep learning은 높은 정확도를 보이면서 다양한 도메인에서 효과적으로
사용되고 있음
– Recurrent Neural Network
– Convolutional Neural Network
• 다른 도메인에서 FNN을 사용해야하는 경우에는 오히려 기존 ML 기법들
(gradient boosting, SVM, random forest)가 더 높은 정확도를 보임
• 또한, FNN이 deep한 경우에는 오히려 정확도가 낮아지는 경우가 발생함
– 최대 4개의 hidden layer가 적당함
=> Deep 한 FNN을 안정적으로 학습하기 어렵고, 원하는 정확도를 나타내지 못함
Feb 12, 2018 Page 41/52
Motivation
• Deep한 neural network를 안정적으로 training하기 위해 다양한 normalization
기술들이 존재함
– Batch Norm, Weight Norm, Layer Norm, …etc
• Deep한 FNN에 대해서는 (RNN, CNN과 달리) normalization을 사용하여 학습을
하더라도 SGD, dropout, normalization parameter estimation에 의해 학습이
불안정해짐
=> 안정적으로 deep한 FNN을 학습할 수 있는 Neural Network 구조를 구축해보자
MNIST CIFAR10
Feb 12, 2018 Page 42/52
Self-normalizing Neural Networks (SNNs)
• Self-normalizing neural network
– 가정: 한 layer의 𝜇, 𝜈 -> 다음 layer의 𝜇W, 𝑣W 로 mapping시켜주는 함수를 g라고 하자
ü 한 layer의 𝜇, 𝜈 에서 다음 layer의 𝜇W, 𝑣W 값이 계산되는 과정을 g 함수로 abstraction
– 조건
1) g에 의해 mapping된 𝜇W, 𝑣W 는 stable해야 함
2) 𝜇, 𝜈 가 g에 의해 반복적으로 mapping 될 때 해당 𝜇W, 𝑣W가 stable한 값으로 수렴해야 함
– 요약
ü SNN은 input data가 layer를 거쳐가면서 안정적인 distribution을 갖는 지점으로 self 수렴되는
neural network임
한 layer 다음 layer
Feb 12, 2018 Page 43/52
Overview of SNN
• Activation function & weight initialization 제안
New Activation functionWeight initialization
𝐸 𝑤Z = 0, 𝑉𝑎𝑟 𝑤Z =
>
_
		, 만족하는 Gaussian
distribution으로 부터 weight을 초기화
Stable① ②
Feb 12, 2018 Page 44/52
Scaled exponential linear unit (SeLU)
• Self normalizing 특성을 갖는 activation function을 제안
• 조건
① 양수, 음수 값을 가져야 함
② Saturation 영역이 존재해야 함
③ 기울기가 1보다 큰 지점이 존재해야 함
④ Continuous curve를 가져야함
ü 모든 지점이 미분 가능해야 함
* 모든 상황에서 mean, variance가 조정 가능
①
②
③
④
Mean 값을 조정하는 역할
Variance 값을 조정하는 역할
Feb 12, 2018 Page 45/52
SeLU 조건
① 양수, 음수 값을 가져야하는 조건
– mean 값이 양수 영역에 위치하더라도, 음수 영역이 존재하기 때문에 mean 값을
stable한 영역으로 shift 시킬 수 있음
– Vice versa
=> 적절한 mean값으로 조정 가능
Feb 12, 2018 Page 46/52
SeLU 조건
② Saturation 영역이 존재해야하는 조건
– Saturation 영역의 경우 gradient가 0에 가깝기 때문에 값의 변화를 줄여 줌으로써
variance를 낮출 수 있음
③ 기울기가 1보다 큰 영역이 존재해야하는 조건
– 해당 영역의 경우 값들의 변화를 높일 수 있기 때문에, variance를 높일 수 있음
=> 적절한 variance로 값을 조정 가능
Feb 12, 2018 Page 47/52
Additional methods (1/2)
• Weight initialization
– SeLU의 self normalizing 특성이 발휘될 수 있는 특정 범위 내로 값들을 초기화해야 함
ü Variance와 mean 값을 조정을 수행할 수 있도록, 해당 특성을 갖는 영역으로 초기화
– 𝐸 𝑤Z = 0, 𝑉𝑎𝑟 𝑤Z =
>
_
	를	만족하는 정규 분포로 부터 weight을 초기화
Feb 12, 2018 Page 48/52
Additional methods (2/2)
• alpha-dropout
– 일반적인 dropout은 특정 확률로 activation function을 0으로 만듦
ü SeLU를 사용하는 경우, 원하는 mean variance에 대한 수렴을 방해함
ü SeLU의 0이 되는 지점은 gradient 값이 높아 값의 변화를 크게 만듦 (variance가 증가됨)
– Variance를 원하는 범위 내로 유지하기 위해, 특정 확률로 activation function을 (0이
아닌) 𝛼b
만들어 줌
ü Selu의 gradient 값이 0 이 되는 지점의 값은 −𝜆𝛼 (variance를 유지함)
Feb 12, 2018 Page 49/52
최종 SNN
• SeLU + Weight initialization + alpha-dropout
– 특정 layer의 mean과 variance가 다음 layer를 거치면서 zero mean & unit variance로
수렴하게 됨
• Banach fixed point theorem
– 제안하는 방식이 input data가 SeLU를 거쳐가면서 zero mean, unit variance로 수렴을
guarantee하는 것을 수학적으로 증명하였음
Feb 12, 2018 Page 50/52
Experiment
• 비교 방법
– MSRAinit: FNN w/o norm & Microsoft weight initialization (7 hidden layer)
– BatchNorm (4 hidden layer), LayerNorm (6 hidden layer), Weight Norm (8 hidden
layer)
– Highway (7 hidden layer) , Resnet (6 hidden layer)
– SNNs (10 hidden layers)
• 121개의 UCI Machine learning task를 수행
– p-value: 최고의 방법과의 정확도 차이
Feb 12, 2018 Page 51/52
Other Experiments
• Drug discovery: The Tox21 challenge dataset
• Image classification task
– MNIST
ü SNN-CNNs: 99.2%, ReLU + CNN: 99.2%
– CIFAR10
ü SNN-CNNs: 82.5%, ReLU + CNN: 76.1%
Feb 12, 2018 Page 52/52
Conclusion
• Deep learning에서 사용되는 normalization 기법들을 리뷰하였음
• 가장 좋은 방법을 확신할 수는 없지만, 문제의 상황에 따라 선택하여 사용
– Non-i.i.d mini-batches, Small mini-batches
ü Batch renormalization (2017)
– RNN or Noise sensitive model
ü Weight normalization (2016)
ü Layer normalization (2016)
– Deep FNN
ü Self normalizing neural network (2017)
– Otherwise (e.g., CNN)
ü Batch normalization (2015)

More Related Content

Similar to 180212 normalization hyu_dake

Transfer learning usage
Transfer learning usageTransfer learning usage
Transfer learning usageTae Young Lee
 
Chapter 8 - optimization for training deep models
Chapter 8 - optimization for training deep modelsChapter 8 - optimization for training deep models
Chapter 8 - optimization for training deep modelsKyeongUkJang
 
Progressive Growing of GANs for Improved Quality, Stability, and Variation Re...
Progressive Growing of GANs for Improved Quality, Stability, and Variation Re...Progressive Growing of GANs for Improved Quality, Stability, and Variation Re...
Progressive Growing of GANs for Improved Quality, Stability, and Variation Re...태엽 김
 
"simple does it weakly supervised instance and semantic segmentation" Paper r...
"simple does it weakly supervised instance and semantic segmentation" Paper r..."simple does it weakly supervised instance and semantic segmentation" Paper r...
"simple does it weakly supervised instance and semantic segmentation" Paper r...LEE HOSEONG
 
준지도학습 (Semi supervised learning)
준지도학습 (Semi supervised learning)준지도학습 (Semi supervised learning)
준지도학습 (Semi supervised learning)Jiwung Hyun
 
(Nlp)fine tuning 대회_참여기
(Nlp)fine tuning 대회_참여기(Nlp)fine tuning 대회_참여기
(Nlp)fine tuning 대회_참여기OverDeep
 
SAGAN_2024seminar announce_seoultech.pptx
SAGAN_2024seminar announce_seoultech.pptxSAGAN_2024seminar announce_seoultech.pptx
SAGAN_2024seminar announce_seoultech.pptxssuser4b2fe7
 
Supervised Constrastive Learning
Supervised Constrastive LearningSupervised Constrastive Learning
Supervised Constrastive LearningSungchul Kim
 
Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networks Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networks Korea, Sejong University.
 
carrier of_tricks_for_image_classification
carrier of_tricks_for_image_classificationcarrier of_tricks_for_image_classification
carrier of_tricks_for_image_classificationLEE HOSEONG
 
20210131deit-210204074124.pdf
20210131deit-210204074124.pdf20210131deit-210204074124.pdf
20210131deit-210204074124.pdfssusera9c46c
 
Training data-efficient image transformers & distillation through attention
Training data-efficient image transformers & distillation through attentionTraining data-efficient image transformers & distillation through attention
Training data-efficient image transformers & distillation through attentiontaeseon ryu
 
Bert3q KorQuAD Finetuning NLP Challenge
Bert3q KorQuAD Finetuning NLP ChallengeBert3q KorQuAD Finetuning NLP Challenge
Bert3q KorQuAD Finetuning NLP ChallengeOverDeep
 
PR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of SamplesPR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of SamplesSunghoon Joo
 
PR-339: Maintaining discrimination and fairness in class incremental learning
PR-339: Maintaining discrimination and fairness in class incremental learningPR-339: Maintaining discrimination and fairness in class incremental learning
PR-339: Maintaining discrimination and fairness in class incremental learningSunghoon Joo
 

Similar to 180212 normalization hyu_dake (18)

Transfer learning usage
Transfer learning usageTransfer learning usage
Transfer learning usage
 
Chapter 8 - optimization for training deep models
Chapter 8 - optimization for training deep modelsChapter 8 - optimization for training deep models
Chapter 8 - optimization for training deep models
 
Progressive Growing of GANs for Improved Quality, Stability, and Variation Re...
Progressive Growing of GANs for Improved Quality, Stability, and Variation Re...Progressive Growing of GANs for Improved Quality, Stability, and Variation Re...
Progressive Growing of GANs for Improved Quality, Stability, and Variation Re...
 
"simple does it weakly supervised instance and semantic segmentation" Paper r...
"simple does it weakly supervised instance and semantic segmentation" Paper r..."simple does it weakly supervised instance and semantic segmentation" Paper r...
"simple does it weakly supervised instance and semantic segmentation" Paper r...
 
DL from scratch(6)
DL from scratch(6)DL from scratch(6)
DL from scratch(6)
 
NN and PDF
NN and PDFNN and PDF
NN and PDF
 
준지도학습 (Semi supervised learning)
준지도학습 (Semi supervised learning)준지도학습 (Semi supervised learning)
준지도학습 (Semi supervised learning)
 
(Nlp)fine tuning 대회_참여기
(Nlp)fine tuning 대회_참여기(Nlp)fine tuning 대회_참여기
(Nlp)fine tuning 대회_참여기
 
SAGAN_2024seminar announce_seoultech.pptx
SAGAN_2024seminar announce_seoultech.pptxSAGAN_2024seminar announce_seoultech.pptx
SAGAN_2024seminar announce_seoultech.pptx
 
Supervised Constrastive Learning
Supervised Constrastive LearningSupervised Constrastive Learning
Supervised Constrastive Learning
 
Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networks Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networks
 
TinyBERT
TinyBERTTinyBERT
TinyBERT
 
carrier of_tricks_for_image_classification
carrier of_tricks_for_image_classificationcarrier of_tricks_for_image_classification
carrier of_tricks_for_image_classification
 
20210131deit-210204074124.pdf
20210131deit-210204074124.pdf20210131deit-210204074124.pdf
20210131deit-210204074124.pdf
 
Training data-efficient image transformers & distillation through attention
Training data-efficient image transformers & distillation through attentionTraining data-efficient image transformers & distillation through attention
Training data-efficient image transformers & distillation through attention
 
Bert3q KorQuAD Finetuning NLP Challenge
Bert3q KorQuAD Finetuning NLP ChallengeBert3q KorQuAD Finetuning NLP Challenge
Bert3q KorQuAD Finetuning NLP Challenge
 
PR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of SamplesPR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of Samples
 
PR-339: Maintaining discrimination and fairness in class incremental learning
PR-339: Maintaining discrimination and fairness in class incremental learningPR-339: Maintaining discrimination and fairness in class incremental learning
PR-339: Maintaining discrimination and fairness in class incremental learning
 

More from DongGyun Hong

20170928 session basedrec_hyu_dake
20170928 session basedrec_hyu_dake20170928 session basedrec_hyu_dake
20170928 session basedrec_hyu_dakeDongGyun Hong
 
20170216 conv mf_hyu_dake
20170216 conv mf_hyu_dake20170216 conv mf_hyu_dake
20170216 conv mf_hyu_dakeDongGyun Hong
 
20190901 seq2 sparql_kips
20190901 seq2 sparql_kips20190901 seq2 sparql_kips
20190901 seq2 sparql_kipsDongGyun Hong
 
20181217 sac dong_gyun_hong
20181217 sac dong_gyun_hong20181217 sac dong_gyun_hong
20181217 sac dong_gyun_hongDongGyun Hong
 
20181106 survey on challenges of question answering in the semantic web saltlux
20181106 survey on challenges of question answering in the semantic web saltlux20181106 survey on challenges of question answering in the semantic web saltlux
20181106 survey on challenges of question answering in the semantic web saltluxDongGyun Hong
 
20200923 open domain-qa_saltlux
20200923 open domain-qa_saltlux20200923 open domain-qa_saltlux
20200923 open domain-qa_saltluxDongGyun Hong
 

More from DongGyun Hong (7)

20170928 session basedrec_hyu_dake
20170928 session basedrec_hyu_dake20170928 session basedrec_hyu_dake
20170928 session basedrec_hyu_dake
 
20170216 conv mf_hyu_dake
20170216 conv mf_hyu_dake20170216 conv mf_hyu_dake
20170216 conv mf_hyu_dake
 
20190901 seq2 sparql_kips
20190901 seq2 sparql_kips20190901 seq2 sparql_kips
20190901 seq2 sparql_kips
 
20181103 kbcqa kips
20181103 kbcqa kips20181103 kbcqa kips
20181103 kbcqa kips
 
20181217 sac dong_gyun_hong
20181217 sac dong_gyun_hong20181217 sac dong_gyun_hong
20181217 sac dong_gyun_hong
 
20181106 survey on challenges of question answering in the semantic web saltlux
20181106 survey on challenges of question answering in the semantic web saltlux20181106 survey on challenges of question answering in the semantic web saltlux
20181106 survey on challenges of question answering in the semantic web saltlux
 
20200923 open domain-qa_saltlux
20200923 open domain-qa_saltlux20200923 open domain-qa_saltlux
20200923 open domain-qa_saltlux
 

180212 normalization hyu_dake

  • 1. Feb 12, 2018 Page 1/52 Normalization in Deep Neural Network 홍동균, 조경재 한양대학교
  • 2. Feb 12, 2018 Page 2/52 Contents • Batch normalization (ICML 2015) • Layer normalization (NIPS 2016) • Weight normalization (NIPS 2016) • Batch renormalization (NIPS 2017) • Self-Normalizing Neural Networks (NIPS 2017)
  • 3. Feb 12, 2018 Page 3/52 Batch Normalization
  • 4. Feb 12, 2018 Page 4/52 Background • Neural network 학습 과정에서 sigmoid를 사용했을 경우 – Saturation problem: Gradient가 0에 가까운 saturation 영역에 도달하는 경우 학습이 제대로 되지 않는 문제 – 특히 network가 deep할 수록 이전 layer들의 parameter 값 변경이 현재 layer input 값을 크게 변경하여 saturation 영역으로 도달할 가능성을 더 높게 함 𝑤𝑥 + 𝑏 𝒙 < 𝑤𝑥 + 𝑏
  • 5. Feb 12, 2018 Page 5/52 Motivation • Saturation problem을 완화하는 기존 방안 – Careful parameter initialization – Small learning rate – Non-saturating nonlinearities (ReLu 등)의 사용 • 그러나 논문에서는 좀 더 근본적으로 saturation problem을 완화하여 학습 속도를 향상시키고자 함 𝑤𝑥 + 𝑏 ReLu 𝑥
  • 6. Feb 12, 2018 Page 6/52 Internal Covariate Shift • 학습 과정에서 각 layer input의 distribution이 이전 layer parameter 변화에 따라 계속해서 달라짐 • 각 layer input의 distribution을 normalize한다면 Internal covariate shift 문제를 완화하고, 학습 속도를 빠르게 할 수 있다고 주장
  • 7. Feb 12, 2018 Page 7/52 Batch Normalization Transform (1/3) • Input의 각 차원이 독립적이라고 가정하여, 각 차원 별로 normalize 함 • 전체 훈련 데이터 대신 mini-batch 단위로 normalize 함 • BN transform은 미분 가능하도록 network에 포함되어 있음 – Input distributions이 internal covariate shift 문제를 겪지 않는 방향으로 학습 될 수 있도록
  • 8. Feb 12, 2018 Page 8/52 Batch Normalization Transform (2/3) • Input의 각 차원이 독립적이라고 가정하여, 각 차원 별로 normalize 함 – 이 가정을 통해서 covariance matrix를 계산할 필요 없이, 해당 차원의 스칼라 값만으로 normalize 가능함 -> 계산량 감소 – 이 때, 위 가정이 layer의 표현력을 제한할 수 있기 때문에, (입력에 의해 sigmoid 값이 linear한 영역에만 머무르는 문제) 추가적인 transformation을 사용함
  • 9. Feb 12, 2018 Page 9/52 Batch Normalization Transform (3/3) • 전체 훈련 데이터 대신 현재 mini-batch에 대해서 normalize 함
  • 10. Feb 12, 2018 Page 10/52 Batch Normalization Inference • Inference 과정에서는 training에서와 다르게 단일 input에 대해 output를 얻어야 함 – 학습 과정에서 평균과 분산의 moving average를 계산해 두고, 이를 inference 과정의 normalization에서 이용함 Training Inference
  • 11. Feb 12, 2018 Page 11/52 Batch Normalization enables higher learning rates • Deep neural network에서 learning rate를 크게 하면 gradient exploding 문제를 겪을 수 있음 – Large learning rate -> increase the scale of parameters -> gradient explosion • Batch normalization에서는 이를 방지
  • 12. Feb 12, 2018 Page 12/52 Batch normalization 장점 • Internal covariate shift 문제를 완화 함 • Deep neural network의 학습 속도를 향상 시킴 – Learning rate 값을 크게 할 수 있음 • Large-scale image recognition에서 뛰어난 성능을 보임
  • 13. Feb 12, 2018 Page 13/52 Experiments (1/2) BN reduces internal covariate shift 85th %ile 15th %ile 50th %ile • 실험 환경 – MNIST: 3 FC hidden layers + softmax, 100 activations per hidden layer – (b), (c): Distribution of inputs to a sigmoid(last layer), evolving over 100k steps • 실험 결과 – (a)에서 BN을 사용한 경우 학습 수렴 속도와 test 정확도의 향상을 확인 함 – (b)에 비해 (c)에서 BN을 사용함으로써 layer의 input distribution이 안정화 되었음을 보임 (=internal covariate shift 문제를 완화)
  • 14. Feb 12, 2018 Page 14/52 Experiments (2/2) ImageNet Classification • 실험 환경 – Inception: deep convolutional ReLU model – 각 convolutional layer에 BN을 적용하였음 • 실험 결과: BN의 효과로 학습 속도, 정확도가 향상 됨 – 큰 learning rate 사용, drop out 제거 등의 hyper-parameter 수정을 통해 학습 속도를 크게 향상 시킴 (BN-x5: 최대 약 15배) – ReLu 대신 sigmoid를 사용하여도 학습이 제대로 됨 (BN-x5-Sigmoid) ü Sigmoid를 사용한 inception 모델의 경우에는 매우 낮은 정확도(0.1%)를 갖음
  • 15. Feb 12, 2018 Page 15/52 Conclusion • Batch normalization은 internal covariate shift 문제를 완화하여 학습 속 도를 향상 시켜주었음 • Batch normalization의 단점 – Mini-batch에 의존적인 normalization 방식 ü Layer normalization (NIPS 2016) ü Weight normalization (NIPS 2016) – Training과 test에서의 normalization 방식이 다름 ü Batch renormalization (NIPS 2017) – Deep feed-forward network에서는 효과적이지 않음 ü Self-normalizing neural network (NIPS 2017)
  • 16. Feb 12, 2018 Page 16/52 Layer & Weight Normalization
  • 17. Feb 12, 2018 Page 17/52 Background • Batch norm의 단점: Mini-batch에 의존적인 normalization – Recurrent model에서 적합하지 않음 – Mini-batch size가 작을 경우 불안정한 학습의 결과 • 위 단점을 해소하기 위해 mini-batch에 의존적이지 않은 normalization 방법 제안 – Layer norm ü Mini-batch와 독립적으로, 각 layer의 input을 normalization하는 방법 제안 – Weight norm ü Neural network weight vectors의 re-parameterization 방법 제안
  • 18. Feb 12, 2018 Page 18/52 Batch normalization in recurrent model • Input sequence의 각 time-step 마다, mini-batch의 평균과 분산을 계산 – Training 데이터에 없거나 드물게 등장한 time-step에 대해 계산한 평균과 분산은 신뢰성이 낮음 Mini-batch Test ? Time-step
  • 19. Feb 12, 2018 Page 19/52 Layer normalization (1/2) • Input sequence의 각 time-step 마다, mini-batch와 독립적으로 평균과 분산을 계산하여 normalization – Mini-batch에 대한 의존성이 없음 – Training과 test 과정에서의 normalize 방식이 동일 Mini-batch Test
  • 20. Feb 12, 2018 Page 20/52 Layer normalization (2/2) • 현재 layer의 모든 input activation feature들에 대하여 평균과 분산을 계산하여 normalize • 𝐠, 𝒃: gain, bias parameter – BN에서 𝛾, 𝛽와 같은 기능 𝑾 𝒉𝒉 𝒉 𝒕/𝟏 𝑾 𝒙𝒉𝒙 𝒕 𝒉 𝒕 𝒂 𝟏 𝒕 𝒂 𝟑 𝒕 𝒂 𝟐 𝒕 𝒇() 𝒉 𝟑 𝒕𝒉 𝟐 𝒕 𝒉 𝟏 𝒕 𝑾 𝒉𝒚
  • 21. Feb 12, 2018 Page 21/52 Layer norm Experiments (1/2) Question-answering task with recurrent model • LN을 적용하여 수렴 속도를 빠르게 하고, validation error를 더 낮출 수 있었음 – 기존 모델 (LSTM 기반 attentive reader model)에 적용 전후 결과 비교 [Teaching machines to read and comprehend, NIPS 2015] – 기존 모델에 Batch norm을 적용한 연구와의 비교 [Recurrent Batch Normalization, ICLR 2017]
  • 22. Feb 12, 2018 Page 22/52 Layer norm Experiments (2/2) Permutation invariant MNIST • FFN 기반의 분류 모델을 batch-size를 다르게 하여 실험 – LN이 BN을 적용했을 때 보다 수렴 속도가 빠르고, batch-size 변화에 robust 함 Batch-size가 작아졌을 때 불안정한 test error를 보임
  • 23. Feb 12, 2018 Page 23/52 Weight normalization (1/3) • Reparameterization of weight vectors in neural network – Weight vector의 길이 (𝑔) 와 방향 (𝐯/| 𝐯 |) 을 분리 함 ü 𝑔: scalar parameter, 𝒗: parameter vector – SGD 학습 과정에서 위의 파라미터들이 각각 학습 됨 – Mini-batch와 독립적인 방식
  • 24. Feb 12, 2018 Page 24/52 Weight normalization (2/3) • Gradients of weight vector • Weight normalization의 장점: Learning rate 값에 대하여 robust 함 – 큰 값의 learning rate로 인해 학습 과정에서 | v | 가 계속해서 커지더라도, gradient의 scale factor( > | ? | )가 점차 감소하여 effective learning rate는 감소함 ü Large learning rate -> fast decay ü Small learning rate -> slow decay
  • 25. Feb 12, 2018 Page 25/52 Weight normalization (3/3) • Data-dependent parameter initialization – Weight normalization은 parameter initialization에 robust 하지 않으므로 적절한 initialization 방법이 필요함 1. Random initialization v ü 논문에서는 평균 0, 표준 편차 0.05인 정규 분포 사용 2. Compute 𝜇[𝑡], 𝜎[𝑡] (t = FGH | F | ) ü 𝜇[𝑡], 𝜎[𝑡]는 하나의 mini-batch에 대하여 계산함 3. Data-dependent initialization 𝑔 ← > J[L] , 𝑏 ← / N[L] J[L] 4. Calculate output 𝐲 = 𝜙 Q | F | v G x + 𝑏 = 𝜙 L / N L J L BN와 유사한 방식 (BN이 잘 동작하는 상황에서 적용 가능)
  • 26. Feb 12, 2018 Page 26/52 Weight norm Experiments (1/2) Supervised classification • WN의 결과는 BN과 비슷한 수렴 속도, test error를 보여줌 • Weight norm + Mean-only batch normalization – Weight norm 방법은 batch norm의 regularize 효과가 더해졌을 때 test error를 더 낮출 수 있었음
  • 27. Feb 12, 2018 Page 27/52 Weight norm Experiments (2/2) Recurrent & Generative Model • Parameterization의 변경 만으로 recurrent model, generative model 에서 효과가 있음을 보임 – 수렴 속도가 빠르고, better optimum으로 수렴 – Noise-sensitive한 특성이 있는 generative model에도 효과적 DRAW (recurrent generative model) on MNIST Convolutional VAE (generative model) on CIFAR-10
  • 28. Feb 12, 2018 Page 28/52 Batch norm, Weight norm, Layer norm Batch norm Weight norm Layer norm 방식 - Mini-batch 단위로 normalization - Weight vector의 reparameterization - 하나의 layer의 모든 input feature에 대하여 normalization 장점 - CNN 모델에서 좋은 분류 성 능을 보임 - Mini-batch에 의존적이지 않음 (Recurrent model, generative model에서 좋은 성능) 단점 - Mini-batch에 의존적으로 recurrent model, noise-sensitive model에서는 잘 동작하지 않음 - Mini-batch size가 작은 경우 불안정 - Training과 test에서의 계산 방 법이 다름 - Parameter initialization에 robust 하지 않음 - CNN model에 대해서는 BN을 적용하는 것이 더 좋음
  • 29. Feb 12, 2018 Page 29/52 Batch normalization의 단점 • Mini-batch에 의존적인 normalization 방식 – Layer normalization (NIPS 2016) – Weight normalization (NIPS 2016) • Training과 test에서의 normalization 방식이 다름 – Batch renormalization (NIPS 2017) • Deep feed-forward network에서는 효과적이지 않음 – Self-normalizing neural network (NIPS 2017)
  • 30. Feb 12, 2018 Page 30/52 Batch Renormalization
  • 31. Feb 12, 2018 Page 31/52 Background • Batch normalization은 deep network를 학습하는데 필수적으로 사용되고 있음 – 각 layer들의 input distribution을 normalize함으로써 학습이 안정화되고, 정확도 손실 없이 학습 속도가 크게 개선되었음 • Batch normalization의 limitation – Training 단계에서의 normalize 방법이 inference단계에서와 다름 – Training 단계에서 학습된 parameter들은 inference 단계에서 효과가 제대로 발휘 되지 않을 수 있음 ü Small mini-batch, Non-i.i.d mini-batch에서는 문제가 더 악화됨 ≠ Training: mini-batch wise Inference: moving average
  • 32. Feb 12, 2018 Page 32/52 Small mini-batches • Mini-batch의 size가 작은 경우를 의미함 • 문제점 – Small mini-batch를 기반으로 계산된 mean, variance가 reliable하지 않음 – 특히, layer의 depth가 깊은 경우, 계산되는 mean, variance의 reliability가 더 낮아질수 있음 – Inference 단계에서는 (전체 training set이 고려된) moving average를 기반으로 normalize를 하기 때문에 문제가 더 악화됨 Training step: mini-batch size 4 Inference step: moving average 2 3 1 4 2 3 1 4 … 5 1 2 ≠
  • 33. Feb 12, 2018 Page 33/52 Non i.i.d mini-batches • 특정 distribution을 갖는 data들로 mini-batch들이 구성됨 – 전체 training set이 갖는 distribution과는 다른 특정 distribution – 학습 과정에서 mini-batch 의존적으로 normalize를 수행하기 때문에 모델이 전체 training set의 general한 distribution이 아닌 각 mini-batch의 distribution에 overfit되는 문제가 발생함 • Inference 단계에서는 moving average를 기반으로 normalize를 수행하기 때문에 inference의 결과가 좋지 않음 각 mini-batch들의 distribution training data distribution ≠
  • 34. Feb 12, 2018 Page 34/52 Batch Renormalization • Training ① Batch norm과 동일하게 mini-batch 기반으로 mean, variance를 계산 ② 해당 mean, variance로 normalize된 값을 moving average를 기반으로 보정 (renorm) ü Moving average가 반영된 r & d parameter를 사용함 =>전체 training set을 고려하여 mini-batch 기반으로 normalize된 값을 보정 (mini-batch 의존성을 해결) • Inference ③ Moving average를 기반으로 normalize ü Training normalize ≈ Inference normalize ① ③ ②
  • 35. Feb 12, 2018 Page 35/52 Batch Renormalization • Batch Norm의 장점을 보존 – Parameter initialization insensitive – Higher learning rate이 가능함 ü Batch norm처럼 학습 속도가 빨라짐 • Batch Norm의 단점을 보완 – Moving average를 기반으로 train 단계에서 mini-batch 단위로 normalize된 값을 보정 ü Mini-batch에 의존적이지 않게 됨 – Training, Inference 단계의 normalize 방법의 차이가 완화됨 =>small mini-batch, non-i.i.d mini-batch의 경우에도 잘 동작함
  • 36. Feb 12, 2018 Page 36/52 Experiment: ImageNet Classification • 실험 세팅 – Inception: deep convolutional ReLU model – 각 convolutional layer에 BN, BRN을 적용하였음 • Small mini-batch에 대한 정확도 실험 – (a): Mini-batch size 32 ü Mini-batch 의존성이 해결되면서, 정확도 조금 개선됨 – (b): Mini-batch size 4 ü Batch norm small mini-batch에 대해서 취약함을 보임 ü Batch renorm이 stable함을 보임 ü Batch Renorm은 더 빠르게 learning이 수행됨 § (130k에서 수렴)
  • 37. Feb 12, 2018 Page 37/52 Non-i.i.d mini-batch에 대한 정확도 실험 • Batchnorm이 non-i.i.d mini-batch에 대해선 취약함을 보임 – Training step이 증가하면서 정확도가 낮아지는 경향을 보임 ü 78.3% -> 67.0%로 정확도가 낮아짐 – Non-i.i.d mini-batch의 training accuracy 또한 낮은 정확도를 보임 ü 78.3% > 72.8% • Non-i.i.d로 test set을 구성하고 𝜇U, 𝜎U로 normalize를 수행할 경우 정확도가 조금 높아짐 – Non-i.i.d mini-batch로 학습한 model은 overfit되어 학습된 것을 보임 ü 67% -> 76.5% • BatchRenorm의 경우 non-i.i.d mini-batch에 대해서 stable함 – Training step이 증가하면서 높은 정확도로 수렴함 ü 67.0% -> 78.6%로 정확도가 크게 개선됨
  • 38. Feb 12, 2018 Page 38/52 Conclusion • Batch normalization 특정 case에 취약함을 보임 – Small mini-batch, Non-i.i.d mini-batch – Training과 Inference의 normalize가 다르기 때문에 위 문제가 더 악화됨 • Batch norm의 문제를 개선하는 Batch Renormalization을 제안하였음 – Mini-batch 기반으로 계산된 mean & variance에 대해서 moving average를 고려하여 보정함으로 써 mini-batch 의존적인 문제를 해결하였음 – Training과 inference의 normalize에 대한 차이를 완화하여 small mini-batch, Non-i.i.d mini-batch에 stable함 – 실험을 통해 효용성을 입증하였음
  • 39. Feb 12, 2018 Page 39/52 Self-Normalizing Neural Networks
  • 40. Feb 12, 2018 Page 40/52 Background • Deep learning은 높은 정확도를 보이면서 다양한 도메인에서 효과적으로 사용되고 있음 – Recurrent Neural Network – Convolutional Neural Network • 다른 도메인에서 FNN을 사용해야하는 경우에는 오히려 기존 ML 기법들 (gradient boosting, SVM, random forest)가 더 높은 정확도를 보임 • 또한, FNN이 deep한 경우에는 오히려 정확도가 낮아지는 경우가 발생함 – 최대 4개의 hidden layer가 적당함 => Deep 한 FNN을 안정적으로 학습하기 어렵고, 원하는 정확도를 나타내지 못함
  • 41. Feb 12, 2018 Page 41/52 Motivation • Deep한 neural network를 안정적으로 training하기 위해 다양한 normalization 기술들이 존재함 – Batch Norm, Weight Norm, Layer Norm, …etc • Deep한 FNN에 대해서는 (RNN, CNN과 달리) normalization을 사용하여 학습을 하더라도 SGD, dropout, normalization parameter estimation에 의해 학습이 불안정해짐 => 안정적으로 deep한 FNN을 학습할 수 있는 Neural Network 구조를 구축해보자 MNIST CIFAR10
  • 42. Feb 12, 2018 Page 42/52 Self-normalizing Neural Networks (SNNs) • Self-normalizing neural network – 가정: 한 layer의 𝜇, 𝜈 -> 다음 layer의 𝜇W, 𝑣W 로 mapping시켜주는 함수를 g라고 하자 ü 한 layer의 𝜇, 𝜈 에서 다음 layer의 𝜇W, 𝑣W 값이 계산되는 과정을 g 함수로 abstraction – 조건 1) g에 의해 mapping된 𝜇W, 𝑣W 는 stable해야 함 2) 𝜇, 𝜈 가 g에 의해 반복적으로 mapping 될 때 해당 𝜇W, 𝑣W가 stable한 값으로 수렴해야 함 – 요약 ü SNN은 input data가 layer를 거쳐가면서 안정적인 distribution을 갖는 지점으로 self 수렴되는 neural network임 한 layer 다음 layer
  • 43. Feb 12, 2018 Page 43/52 Overview of SNN • Activation function & weight initialization 제안 New Activation functionWeight initialization 𝐸 𝑤Z = 0, 𝑉𝑎𝑟 𝑤Z = > _ , 만족하는 Gaussian distribution으로 부터 weight을 초기화 Stable① ②
  • 44. Feb 12, 2018 Page 44/52 Scaled exponential linear unit (SeLU) • Self normalizing 특성을 갖는 activation function을 제안 • 조건 ① 양수, 음수 값을 가져야 함 ② Saturation 영역이 존재해야 함 ③ 기울기가 1보다 큰 지점이 존재해야 함 ④ Continuous curve를 가져야함 ü 모든 지점이 미분 가능해야 함 * 모든 상황에서 mean, variance가 조정 가능 ① ② ③ ④ Mean 값을 조정하는 역할 Variance 값을 조정하는 역할
  • 45. Feb 12, 2018 Page 45/52 SeLU 조건 ① 양수, 음수 값을 가져야하는 조건 – mean 값이 양수 영역에 위치하더라도, 음수 영역이 존재하기 때문에 mean 값을 stable한 영역으로 shift 시킬 수 있음 – Vice versa => 적절한 mean값으로 조정 가능
  • 46. Feb 12, 2018 Page 46/52 SeLU 조건 ② Saturation 영역이 존재해야하는 조건 – Saturation 영역의 경우 gradient가 0에 가깝기 때문에 값의 변화를 줄여 줌으로써 variance를 낮출 수 있음 ③ 기울기가 1보다 큰 영역이 존재해야하는 조건 – 해당 영역의 경우 값들의 변화를 높일 수 있기 때문에, variance를 높일 수 있음 => 적절한 variance로 값을 조정 가능
  • 47. Feb 12, 2018 Page 47/52 Additional methods (1/2) • Weight initialization – SeLU의 self normalizing 특성이 발휘될 수 있는 특정 범위 내로 값들을 초기화해야 함 ü Variance와 mean 값을 조정을 수행할 수 있도록, 해당 특성을 갖는 영역으로 초기화 – 𝐸 𝑤Z = 0, 𝑉𝑎𝑟 𝑤Z = > _ 를 만족하는 정규 분포로 부터 weight을 초기화
  • 48. Feb 12, 2018 Page 48/52 Additional methods (2/2) • alpha-dropout – 일반적인 dropout은 특정 확률로 activation function을 0으로 만듦 ü SeLU를 사용하는 경우, 원하는 mean variance에 대한 수렴을 방해함 ü SeLU의 0이 되는 지점은 gradient 값이 높아 값의 변화를 크게 만듦 (variance가 증가됨) – Variance를 원하는 범위 내로 유지하기 위해, 특정 확률로 activation function을 (0이 아닌) 𝛼b 만들어 줌 ü Selu의 gradient 값이 0 이 되는 지점의 값은 −𝜆𝛼 (variance를 유지함)
  • 49. Feb 12, 2018 Page 49/52 최종 SNN • SeLU + Weight initialization + alpha-dropout – 특정 layer의 mean과 variance가 다음 layer를 거치면서 zero mean & unit variance로 수렴하게 됨 • Banach fixed point theorem – 제안하는 방식이 input data가 SeLU를 거쳐가면서 zero mean, unit variance로 수렴을 guarantee하는 것을 수학적으로 증명하였음
  • 50. Feb 12, 2018 Page 50/52 Experiment • 비교 방법 – MSRAinit: FNN w/o norm & Microsoft weight initialization (7 hidden layer) – BatchNorm (4 hidden layer), LayerNorm (6 hidden layer), Weight Norm (8 hidden layer) – Highway (7 hidden layer) , Resnet (6 hidden layer) – SNNs (10 hidden layers) • 121개의 UCI Machine learning task를 수행 – p-value: 최고의 방법과의 정확도 차이
  • 51. Feb 12, 2018 Page 51/52 Other Experiments • Drug discovery: The Tox21 challenge dataset • Image classification task – MNIST ü SNN-CNNs: 99.2%, ReLU + CNN: 99.2% – CIFAR10 ü SNN-CNNs: 82.5%, ReLU + CNN: 76.1%
  • 52. Feb 12, 2018 Page 52/52 Conclusion • Deep learning에서 사용되는 normalization 기법들을 리뷰하였음 • 가장 좋은 방법을 확신할 수는 없지만, 문제의 상황에 따라 선택하여 사용 – Non-i.i.d mini-batches, Small mini-batches ü Batch renormalization (2017) – RNN or Noise sensitive model ü Weight normalization (2016) ü Layer normalization (2016) – Deep FNN ü Self normalizing neural network (2017) – Otherwise (e.g., CNN) ü Batch normalization (2015)