การออกแบบโมเดล: คลาส nn.Module

การสร้างโครงข่ายประสาทเทียมใน PyTorch ก็เหมือนกับการประกอบ LEGO ใน _init_ คุณประกาศส่วนต่างๆ (เลเยอร์) และข้างหน้า คุณระบุว่าอินพุตเทนเซอร์ควรไหลผ่านส่วนเหล่านั้นอย่างไรเพื่อให้กลายเป็นการทำนาย ข้อได้เปรียบหลักของ nn.Module ก็คือมันจะติดตามพารามิเตอร์ (น้ำหนัก) ทั้งหมดภายในเลเยอร์ของมันโดยอัตโนมัติ

Full content is available with a subscription.
Get full access to all courses on the platform for one year with a single payment.
Unlike other platforms that charge per course, here you get everything for one price, and after one year of use there will be no automatic charge for the following year.