【发布时间】:2020-12-19 19:33:08
【问题描述】:
我一直无法在张量板上绘制我的学习率,因为我使用的是 ReduceLROnPlateau,如下所示:
tensorboard_callback = tf.keras.callbacks.TensorBoard(log_dir=results_path, histogram_freq=1)
reduce_lr = ReduceLROnPlateau(monitor='loss', factor=0.5, verbose=1,
patience=100, min_lr=0.000001)
callbacks = [tensorboard_callback, reduce_lr]
# Compile VAE
vae.compile(optimizer='adam', loss=kl_reconstruction_loss, metrics=["mse", metric_KL,binary_crossentropy])
# Train autoencoder
history = vae.fit(x_train, x_train,
epochs = no_epochs,
batch_size = batch_size,
validation_data=(x_test,x_test,),
callbacks=callbacks)
之后我运行它以将自定义指标绘制到 tensorboard 日志:
for epoch in range(len(history.history['mse'])):
with train_summary_writer.as_default():
tf.summary.scalar('metric_KL', history.history['metric_KL'][epoch], step=epoch)
使用该设置。如何在不编写自己的自定义 ReduceLROnPlateau 的情况下绘制我的学习率? 谢谢
【问题讨论】:
标签: python tensorflow learning-rate