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

เกรเดียนต์ชี้ขึ้นเนิน — จึงก้าวไปอีกทาง

ใช้ความชันเพื่อปรับปรุงน้ำหนัก

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

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

Reading the Slope

To walk downhill you first need to know which way is down. The gradient is the tool that tells you the slope of the loss at your current spot.

Gradient Points Uphill

Here is the surprise: the gradient points in the direction where loss increases fastest. It shows you the steepest way up, not down.

So Step the Other Way

Since the gradient aims uphill, you move in the opposite direction to go down. Subtracting the gradient takes you toward lower loss.

w = w - grad

The Update Rule

This one line is the heart of training. You scale the gradient by a small step size, then subtract it from each weight. Repeat and loss drops.

w = w - lr * grad

Gradient Is a Vector

With many weights, the gradient is a whole vector: one slope per weight. Each weight gets nudged by its own piece of that vector.

Magnitude Means Steepness

A large gradient value means the loss is very steep in that direction, so that weight needs a bigger correction. Small values mean you are nearly flat there.

Where Gradient Is Zero

At the very bottom of a valley the slope flattens and the gradient becomes zero. With nothing to subtract, the weights stop moving. You have converged.

One Step at a Time

You almost never reach the bottom in one jump. Each step only improves things a little, so descent is a long series of tiny downhill moves.

Following the Negative Gradient

The path you trace by always heading along the negative gradient is the route of steepest descent. It is the greedy shortcut toward lower loss.

step = -grad

Why Subtraction Works

Subtracting moves you against the increase, so loss must fall for a small enough step. That simple sign flip is what turns a slope into progress.

Toward Automatic Gradients

You will rarely compute these slopes by hand. PyTorch's autograd finds the gradient for you, but the rule stays the same: subtract it to descend.

Quick Check

Which direction does the gradient point?

Recap

The gradient points uphill toward higher loss, so you subtract a scaled version of it to step down. Repeat that update and the model rolls toward the valley. ⬇️

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

บทเรียน “เกรเดียนต์ชี้ขึ้นเนิน — จึงก้าวไปอีกทาง” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “เกรเดียนต์ชี้ขึ้นเนิน — จึงก้าวไปอีกทาง” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ 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 ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน

บทเรียน “เกรเดียนต์ชี้ขึ้นเนิน — จึงก้าวไปอีกทาง” ใช้เวลานานแค่ไหน

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

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

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

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

  1. มองค่าความสูญเสียเป็นภูมิประเทศที่ต้องไต่ลง
  2. เกรเดียนต์ชี้ขึ้นเนิน — จึงก้าวไปอีกทาง
  3. อัตราการเรียนรู้: ใหญ่เกินไป เล็กเกินไป หรือพอดี
  4. ลดค่าฟังก์ชันด้วยมือใน Python
← กลับไปที่ Deep Learning Academy