Dynamic learning rate in training - 培训中的动态学习率
I'm using keras 2.1.* and want to change the learning rate during training. I know about the schedule callback, but I don't use fit function and I don't have callbacks. I use train_on_batch. Is it possible in keras ?
Solution 1
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。If you use other functions like train_on_batch, you can change the learning rate with this way
From keras import backend as K Old_lr = K.get_value(model.optimizer.lr) New_lr = old_lr * 0.1 # change however you want K.set_value(model.optimizer.lr, new_lr)
github issue: https://github.com/keras-team/keras/issues/898
aipool discussion: https://ai-pool.com/d/dynamic_learning_rate_in_training

更多精彩