Last active
January 18, 2019 13:01
-
-
Save karolzak/27834b49431d848ee3e08e94f272f5e3 to your computer and use it in GitHub Desktop.
plotting training history for keras unet implementation
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
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| def plot_segm_history(history): | |
| # summarize history for iou | |
| plt.figure(figsize=(12,6)) | |
| plt.plot(history.history['iou'], linewidth=3) | |
| plt.plot(history.history['val_iou'], linewidth=3) | |
| plt.suptitle('iou metric', fontsize=20) | |
| plt.ylabel('iou', fontsize=20) | |
| plt.xlabel('epoch', fontsize=20) | |
| #plt.yticks(np.arange(0.3, 1, step=0.02), fontsize=35) | |
| #plt.xticks(fontsize=35) | |
| plt.legend(['train', 'test'], loc='center right', fontsize=15) | |
| plt.show() | |
| # summarize history for loss | |
| plt.figure(figsize=(12,6)) | |
| plt.plot(history.history['loss'], linewidth=3) | |
| plt.plot(history.history['val_loss'], linewidth=3) | |
| plt.suptitle('loss', fontsize=20) | |
| plt.ylabel('loss', fontsize=20) | |
| plt.xlabel('epoch', fontsize=20) | |
| #plt.yticks(np.arange(0, 0.2, step=0.005), fontsize=35) | |
| #plt.xticks(fontsize=35) | |
| plt.legend(['train', 'test'], loc='center right', fontsize=15) | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment