1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| if __name__ == "__main__":
history = History()
historique = History()
hist = training("/Data/exp42cpi_a/training")
historique = hist
print("Le Summary de historique : ")
historique.summary()
print(historique.history.keys())
# summarize history for accuracy
plt.plot(historique.history['acc'])
plt.plot(historique.history['val_acc'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'valid'], loc='upper left')
print("summarize history for accuracy")
plt.show()
plt.savefig('accuracyVsEpochs.png',facecolor='w', edgecolor='b',orientation='portrait', papertype=None, format=None,
transparent=False, bbox_inches=None, pad_inches=0.1, frameon=None, metadata=None) # function savefig allows to save the graph in a file
# summarize history for loss
plt.plot(historique.history['loss'])
plt.plot(historique.history['val_loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'valid'], loc='upper left')
print("summarize history for loss")
plt.show()
plt.savefig('lossVsEpochs.png',facecolor='w', edgecolor='b',orientation='portrait', papertype=None, format=None,
transparent=False, bbox_inches=None, pad_inches=0.1, frameon=None, metadata=None)""" |
Partager