plot performance Single iteration: plot_performance_single(hist)

PHOTO EMBED

Sat Jul 30 2022 18:11:32 GMT+0000 (Coordinated Universal Time)

Saved by @mnis00014

def plot_performance_single(hist):
    plt.rcParams['figure.figsize'] = (15, 7)
    hist_ = hist.history
    epochs = hist.epoch
    
    plt.subplot(1, 2, 1) # row 1, col 2 index 1
    plt.plot(epochs, hist_['accuracy'], label='Training Accuracy')
    plt.plot(epochs, hist_['val_accuracy'], label='Validation Accuracy')
    plt.xlabel('Epochs')
    plt.ylabel('Accuracy')
    plt.title('Training and validation accuracy')
    plt.legend()
    
    plt.subplot(1, 2, 2) # row 1, col 2 index 1
    plt.plot(epochs, hist_['loss'], label='Training loss')
    plt.plot(epochs, hist_['val_loss'], label='Validation loss')
    plt.xlabel('Epochs')
    plt.ylabel('Loss')
    plt.title('Training and validation loss')
    plt.legend()

    plt.tight_layout(2)
    fig1 = plt.gcf()
    plt.show()
    plt.draw()
    fig1.savefig('tessstttyyy.png', dpi=100)
content_copyCOPY