Hyperparameter
In Bayesian statistics, a hyperparameter is a parameter of a prior distribution; the term is used to distinguish them from parameters of the model for the underlying system under analysis.
For example, if one is using a beta distribution to model the distribution of the parameter p of a Bernoulli distribution, then:
- p is a parameter of the underlying system (Bernoulli distribution), and
- α and β are parameters of the prior distribution (beta distribution), hence hyperparameters.
One may take a single value for a given hyperparameter, or one can iterate and take a probability distribution on the hyperparameter itself, called a hyperprior.
In the Machine learning
신경망(또는 머신 러닝)에서 하이퍼파라미터(Hyperparameter)란, 신경망 학습을 통하여 튜닝 또는 최적화 해야 하는 주 변수가 <span style="color:red;">아닌!, 학습 진도율(\(\eta\); Learning rate)이나 일반화 변수(\(\lambda\))와 같이 사람들이 선험적 직식으로(Priori) 설정하거나 또는 외부 모델 메커니즘을 통해 자동으로 설정되는 변수를 지칭한다.
그 때문에 Meta-parameters 또는 Free-parameters 라고도 한다. Bayesian statistics에서는 사전분포(Priori distribution)를 나타내기 위한 용어로도 사용된다.
List of hyperparameter
- Learning rate
- Gradient descent에서 사용하는 학습 진도율.
- Regularization parameter
- Overfitting의 문제를 피하기 위해 사용하는 일반화 변수(\(\lambda\))는 Weight decay의 속도를 조절하기 위한 용도로 사용할 수가 있다
- Mini-batch 크기
- Mini-batch의 크기가 큰 경우는 병렬연산 구조를 사용할 때 효과적일 수 있으며 크기가 작으면 더 많은 update를 할 수가 있다.
- Training 반복 횟수
- Overfitting을 방지하기 위해 학습의 조기 종료(Early stopping)을 결정하는 변수.
- Hidden unit의 개수
- Hidden layer의 개수가 많아질수록 특정 훈련 데이터에 더 최적화 시킬 수가 있다. 또한 모든 hidden layer의 뉴런의 개수를 동일하게 유지하는 것이 같은 hidden layer의 개수에 뉴런의 개수를 가변적으로 하는 것보다 효과적이다. 또한 첫번째 hidden layer에 있는 뉴런의 개수가 input layer에 있는 뉴런의 개수보다 큰 것이 효과적인 경우가 많다.
- 가중치 초기화 (Weight initialization)
- 초기 바이어스(Bias)값이 학습 결과에 큰영향을 미치기 때문에 중요하다.
Optimization
Hyperparameter 최적화를 위한 대표적인 네 가지 방법을 열거한다.
- Manual search
- 휴리스틱(Heuristic)하게 수정한다. 어떤 "탐색 이론"을 사용하는가에 따라 시간이나 질이 달라질 수 있다.
- Grid search
- 선험적인 지식으로 문제를 분석하고 일정한 간격으로 값을 대입하고 최적의 값을 찾는다.
- Random search
- 무작위 대입.
- Bayesian optimization
- 유명한 논문으로는 Adams 등이 쓴 “Practical Bayesian optimization of machine learning algorithms”가 있다. Bayesian optimization 방법을 사용하면 Random search나 Grid search를 사용하는 것에 비해 좀 더 짧은 시간에 최적값을 찾아내는 경향이 있다.