Keras: how to output learning rate onto tensorboard

后端 未结 4 496
無奈伤痛
無奈伤痛 2021-02-05 10:29

I add a callback to decay learning rate:

 keras.callbacks.ReduceLROnPlateau(monitor=\'val_loss\', factor=0.5, patience=100, 
                                   v         


        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-05 11:14

    You gave the optimizer's code twice, instead of TensorBoard Callback. Anyway, I didn`t find the way to display the learning rate on TensorBoard. I am plotting it after the training finished, taking data from History object:

    nb_epoch = len(history1.history['loss'])
    learning_rate=history1.history['lr']
    xc=range(nb_epoch)
    plt.figure(3,figsize=(7,5))
    plt.plot(xc,learning_rate)
    plt.xlabel('num of Epochs')
    plt.ylabel('learning rate')
    plt.title('Learning rate')
    plt.grid(True)
    plt.style.use(['seaborn-ticks'])
    

    The chart looks like this: LR plot

    Sorry, that is not exactly what you are asking about, but perhaps could help.

提交回复
热议问题