0Pricing
Deep Learning Academy · บทเรียน

การส่งต่อ ค่าความสูญเสีย ย้อนกลับ และก้าวปรับค่า

การเคลื่อนไหวสี่ขั้นของการวนรอบการฝึกหนึ่งครั้ง

การส่งต่อ ค่าความสูญเสีย ย้อนกลับ และก้าวปรับค่า เป็นบทเรียน Deep Learning Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 1 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Deep Learning Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Deep Learning Academy มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

Four Moves, One Beat

Every training iteration is just four moves repeated: forward, loss, backward, step. Learn this rhythm and the whole training loop stops feeling mysterious. 🥁

Move One: Forward

The forward pass sends your input through the model so it produces a prediction. You just call the model on a batch of data and read the output.

pred = model(x)

Logits, Not Answers Yet

The forward output is usually raw scores called logits, not clean labels. The loss function knows how to read these scores directly, so you leave them as is.

Move Two: Loss

Next you measure how wrong the prediction was. The loss compares your output to the true labels and boils the mistake down to one number.

loss = loss_fn(pred, y)

Lower Loss, Better Model

A big loss means a poor prediction and a small one means a good prediction. Training has a single mission: drive this number steadily downward.

Move Three: Backward

Now you ask which way to nudge each weight. The backward pass uses autograd to compute every gradient and fill each parameter's .grad for you.

loss.backward()

Gradients Are Directions

Each gradient tells you how the loss would change if you tweaked that one weight. They are the map the optimizer follows toward a better model.

Move Four: Step

Finally the optimizer applies those gradients, nudging every weight a little. This step is the moment the model actually learns from its mistake.

optimizer.step()

Clear the Grads

Gradients pile up by default, so before the next backward you call zero_grad. Skip it and old gradients corrupt your next update.

optimizer.zero_grad()

The Whole Move

Put the four moves together and you get one clean iteration. You will type this exact pattern in nearly every PyTorch project you build.

optimizer.zero_grad()
pred = model(x)
loss = loss_fn(pred, y)
loss.backward()
optimizer.step()

Then Do It Again

Run these moves on batch after batch and the loss falls a little each time. Thousands of tiny updates are what turn random weights into real skill.

Quick Check

Which call actually computes the gradients for every weight?

Recap

One iteration is four moves: forward for a prediction, loss to measure error, backward for gradients, and step to update weights. Repeat to learn. 🎉

คำถามที่พบบ่อย

บทเรียน “การส่งต่อ ค่าความสูญเสีย ย้อนกลับ และก้าวปรับค่า” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “การส่งต่อ ค่าความสูญเสีย ย้อนกลับ และก้าวปรับค่า” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Deep Learning Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Deep Learning Academy มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “การส่งต่อ ค่าความสูญเสีย ย้อนกลับ และก้าวปรับค่า”

การเคลื่อนไหวสี่ขั้นของการวนรอบการฝึกหนึ่งครั้ง คุณปฏิบัติ Deep Learning Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Deep Learning Academy หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน Deep Learning Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 1 จากทั้งหมด 4 บทเรียน

บทเรียน “การส่งต่อ ค่าความสูญเสีย ย้อนกลับ และก้าวปรับค่า” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน Deep Learning Academy นี้ได้ไหม

ได้ บทเรียน Deep Learning Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. การส่งต่อ ค่าความสูญเสีย ย้อนกลับ และก้าวปรับค่า
  2. เขียนวงจรการฝึกแบบพื้นฐาน
  3. ติดตามความแม่นยำระหว่างการฝึก
  4. โหมดฝึกกับโหมดประเมิน
← กลับไปที่ Deep Learning Academy