티스토리 뷰

728x90

1. Tensorflow 싸이트의 Decaying the learning rate

 글을 작성하기전 Tensorflow에서 제공하고 있는 5개의 decay함수에 대한 정의가 들어있는 싸이트이다.

▪ tf.train.exponential_decay

▪ tf.train.inverse_time_decay

▪ tf.train.natural_exp_decay

▪ tf.train.piecewise_constant

▪ tf.train.polynomial_decay



2. tf.train.exponential_decay 사용법

 사용법 설명은 맨 첫번재 decay 함수인 tf.train.exponential_decay를 설명할 것이다. 홈페이지에 명시되어 있는 파라메터는 다음과 같다.

▪ learning_rate: A scalar float32 or float64 Tensor or a Python number. The initial learning rate.

▪ global_step : A scalar int32 or int64 Tensor or a Python number. Global step to use for the decay computation. Must not be negative.

▪ decay_steps : A scalar int32 or int64 Tensor or a Python number. Must be positive. See the decay computation above.

▪ decay_rate : A scalar float32 or float64 Tensor or a Python number. The decay rate.

▪ staircase : Boolean. If True decay the learning rate at discrete intervals

▪ name : String. Optional name of the operation. Defaults to 'ExponentialDecay'.


 다음은 사용 예제이다.

 

예제의 파라메터 하나씩 보자.

예제에서 첫 번째 파라메터로 들어간 starter_learning_rate는 말 그대로 최초 학습시 사용될 learning_rate이다.

두 번째 파라메터로 사용된 global_step은 현재 학습 횟수이다.

세 번째 파라메터는 위 예제에서는 100000이 들어갔는데 총 학습 횟수이다.

네 번째 파라메터는 얼마나 rate가 감소될 것인가를 나타낸다. 매번 0.96이 곱해진다고 생각하면 된다.

다섯 번째 파라메터는 이산적으로 학습 속도 감속 유무이다. 나는 이산적으로라는 말의 정의가 무엇인지 잘 모르겠지만 해당 파라메터가 true일때 decay_rate 즉 4번째 파라메터에 (global_step / decay_steps)의 승수가 적용된다.

decayed_learning_rate = learning_rate * decay_rate ^ (global_step / decay_steps)


댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함