我一直无法在张量板上绘制我的学习率,因为我正在使用 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 的情况下绘制我的学习率?谢谢