tensorflow学习率自动衰减

reduce_lr = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', 
                                            patience=3, 
                                            verbose=1, 
                                            factor=0.5, 
                                            min_lr=0.00001)

history = model.fit(
    get_train_valid_datasets(), 
    steps_per_epoch=STEPS_PER_EPOCH,
    epochs=EPOCHS, 
    callbacks=[reduce_lr]
)
发布了60 篇原创文章 · 获赞 15 · 访问量 4048

猜你喜欢

转载自blog.csdn.net/qq_15557299/article/details/104351468