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

วิธีใช้ Keras พล็อตโมเดลด้วย Python

Keras (ความหมายภาษากรีก: "Horn") พัฒนาจากโครงการ ONEIROS เป็น Deep Learning API ระดับสูง Python รันบน TensorFlow Scalable, Cross-platform เข้าถึงด้วย from tensorflow import keras

Functional API

สร้างโมเดลที่ยืดหยุ่น รองรับ Non-linear topology, Shared layers, Multiple I/O โมเดลเป็น DAG ของเลเยอร์

ตัวอย่าง: พล็อตโมเดล

print("The model is being plotted")
keras.utils.plot_model(model, "my_resnet.png", show_shapes=True)

Code credit: TensorFlow Keras Functional Guide

ผลลัพธ์

วิธีใช้ Keras พล็อตโมเดลด้วย Python

คำอธิบาย

  • ใช้เมธอด plot_model() พล็อตเลเยอร์ของโมเดลเป็นกราฟ (Graph-of-layers)
  • พารามิเตอร์ show_shapes=True แสดงขนาด Input/Output ของแต่ละเลเยอร์