keras 画训练过程曲线

来源:互联网 发布:手机直播辅助软件 编辑:程序博客网 时间:2024/06/04 01:22
# Fit the modelhistory = tiramisu.fit(train_data, train_label, batch_size=batch_size, epochs=nb_epoch,callbacks=callbacks_list, class_weight=class_weighting,verbose=1, validation_data=(test_data, test_label), shuffle=True) # validation_split=0.33    # This save the trained model weights to this file with number of epochstiramisu.save_weights('weights/prop_tiramisu_weights_67_12_func_10-e7_decay{}.hdf5'.format(nb_epoch)) import matplotlib.pyplot as plt# list all data in historyprint(history.history.keys())# summarize history for accuracyplt.plot(history.history['acc'])plt.plot(history.history['val_acc'])plt.title('model accuracy')plt.ylabel('accuracy')plt.xlabel('epoch')plt.legend(['train', 'test'], loc='upper left')plt.show()# summarize history for lossplt.plot(history.history['loss'])plt.plot(history.history['val_loss'])plt.title('model loss')plt.ylabel('loss')plt.xlabel('epoch')plt.legend(['train', 'test'], loc='upper left')plt.show()
原创粉丝点击