2019. 6. 5. 11:00ㆍ분석 Python/Tensorflow
먼가 지금 학습을 시키는 것이 있는데, 먼가 추가적으로 데이터를 넣으면서 시키는 중이다.
그런데 현재 구조는 learning deacy 방식으로 사용하다 보니, 점점 학습률은 떨어져서 새로운 데이터에 대해서 그만큼
새로운 최적의 값을 못찾는 기분이라서, learning rate를 어떻게 해봐야겠다고 생각을 하고 다음과 같이 수정을 해보려고 한다!
그래서 알아본게 Cyclical로 주기를 만드는 방식이다.
이러면 잘 되겠지 하고 기대를 하면서!!!!!!!!!!
cyclic_learning_rate( global_step, ## Epoch 의미
learning_rate=0.01,
max_lr=0.1, ## 최대 learning rate
step_size=20.,
gamma=0.99994, ## 폭? 작게 할수록 더 진폭이 크게 변한다.
mode='triangular', ## 타입 3가지 잇음.
name=None):
코드는 다음과 같이 살짝 넣어주면 된다!!
learning_rate = tf.placeholder(shape=[], dtype=tf.float32)
opt = tf.train.AdamOptimizer(learning_rate)
lr = sess.run(clr.cyclic_learning_rate(step, learning_rate=0.001 , max_lr=FLAGS.learning_rate , mode='exp_range', gamma=.99994))
loss , _ = sess.run([loss, train_op], feed_dict={input_images: data[0],learning_rate : lr })
https://medium.com/vitalify-asia/whats-up-with-deep-learning-optimizers-since-adam-5c1d862b9db0
What’s up with Deep Learning optimizers since Adam?
A chronological highlight of interesting ideas that try to optimize the optimization process since the advent of Adam:
medium.com
https://github.com/mhmoodlan/cyclic-learning-rate
mhmoodlan/cyclic-learning-rate
Cyclic learning rate TensorFlow implementation. Contribute to mhmoodlan/cyclic-learning-rate development by creating an account on GitHub.
github.com
https://medium.com/@lipeng2/cyclical-learning-rates-for-training-neural-networks-4de755927d46
Cyclical Learning Rates for Training Neural Networks
Learning rate is one of the most important hyper parameters when it comes to training a neural network. It determines the magnitude of…
medium.com
https://bzdww.com/article/4993/
'분석 Python > Tensorflow' 카테고리의 다른 글
tf.Data를 활용하여 csv 파일부터 읽어서 텐서플로우 모델링하기 (0) | 2019.06.16 |
---|---|
Activation (SQNL , Soft Cliping , Gaussian) (0) | 2019.06.09 |
tensorflow mask 씌우기 (0) | 2019.05.30 |
tensorflow 폴더 생성 및 지우기 (0) | 2019.05.28 |
GAN minibatch discrimination code (0) | 2019.05.28 |