This file contains hidden or 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
| history=model.fit(x=ds.train_ds_modeling, | |
| y=None, | |
| batch_size=None, | |
| verbose=1, | |
| validation_split=0.0, | |
| epochs=epochs, | |
| validation_data=ds.test_ds_modeling, | |
| callbacks=callbacks) |
This file contains hidden or 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
| # Create a callback for TensorBoard and put it in a list | |
| callbacks=[tf.keras.callbacks.TensorBoard(log_dir=model_log, | |
| histogram_freq=1, | |
| write_graph=True, | |
| write_images=False, | |
| update_freq='epoch')] | |
| # Create the TensorBoard writer for the confusion matrix writer | |
| cm_file_writer=tf.summary.create_file_writer(logdir=cm_log) |
This file contains hidden or 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) |
OlderNewer