Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> Python

การตรวจสอบการทำนายด้วย matplotlib ใน TensorFlow


แนวคิด

ใช้ matplotlib และ imshow แสดงภาพพร้อมคำทำนายจาก ImageNet

แนวคิด Transfer Learning, TensorFlow Hub, Google Colab เหมือนเดิม

ตัวอย่างโค้ด

print("Predictions are checked")
plt.figure(figsize=(10,9))
plt.subplots_adjust(hspace=0.5)
for n in range(30):
    plt.subplot(6,5,n+1)
    plt.imshow(image_batch[n])
    plt.title(predicted_class_names[n])
    plt.axis('off')
_ = plt.suptitle("ImageNet predictions")

Credit: TensorFlow Tutorials

ผลลัพธ์

การตรวจสอบการทำนายด้วย matplotlib ใน TensorFlow

การตรวจสอบการทำนายด้วย matplotlib ใน TensorFlow

คำอธิบาย

  • ตรวจสอบการทำนายและแสดงผลบนคอนโซล