Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #evaluate the network
  2. print("[INFO] evaluating network...")
  3. predictions = model.predict(testX, batch_size=32)
  4.  
  5. #Uncomment to see the predicted probabilty for each class in every test image
  6. # print ("predictions---------------->",predictions)
  7. #Uncomment to print the predicted labels in each image
  8. # print("predictions.argmax(axis=1)",predictions.argmax(axis=1))
  9.  
  10. # print the performance report of the prediction
  11. print(classification_report(testY.argmax(axis=1),
  12. predictions.argmax(axis=1), target_names=lb.classes_))
  13.  
  14. # plot the training loss and accuracy for each epoch
  15. N = np.arange(0, EPOCHS)
  16. plt.style.use("ggplot")
  17. plt.figure()
  18. plt.plot(N, H.history["loss"], label="train_loss")
  19. plt.plot(N, H.history["val_loss"], label="val_loss")
  20. plt.plot(N, H.history["acc"], label="train_acc")
  21. plt.plot(N, H.history["val_acc"], label="val_acc")
  22. plt.title("Training Loss and Accuracy (simple_multiclass_classifcation)")
  23. plt.xlabel("Epoch #")
  24. plt.ylabel("Loss/Accuracy")
  25. plt.legend()
  26. plt.savefig("training_performance.png")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement