Created
June 17, 2020 00:47
-
-
Save sgodfrey66/b7c435980679d57ad84d9367bda9cb3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define the confusion matrix logging function | |
def cm_logger(epoch, logs): | |
# Create a name for this image | |
i_name='Confusion Matrix: {}; {}'.format(model_name, ds.dataset_name) | |
# Create the per-epoch callback for the confusion matrix | |
cm_image=image_funcs.plot_to_image(metrics_funcs.generate_heatmap( | |
dataset=ds, | |
model=model).figure) | |
# Write it to the logs | |
with cm_file_writer.as_default(): | |
tf.summary.image(name=i_name, data=cm_image, step=epoch) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment