0Pricing
Deep Learning Academy · Pelajaran

Lintasan Maju, Loss, Mundur, Langkah

Empat langkah dalam satu iterasi pelatihan

Lintasan Maju, Loss, Mundur, Langkah adalah pelajaran Deep Learning Academy gratis di CoddyKit. Ini adalah pelajaran 1 dari 4. Kamu bisa membaca pelajaran lengkapnya di bawah secara gratis — lalu praktikkan langsung di browser dengan editor kode bawaan dan tutor AI 24/7. Ini adalah bagian dari jalur belajar Deep Learning Academy, dan progresmu tersinkronisasi di web dan aplikasi CoddyKit. Kursus Deep Learning Academy mencakup 4 pelajaran total.

Bagian dari pelajaran ini belum diterjemahkan dan ditampilkan dalam bahasa Inggris.

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. 🎉

Pertanyaan yang Sering Diajukan

Apakah pelajaran “Lintasan Maju, Loss, Mundur, Langkah” gratis?

Ya — teks lengkap “Lintasan Maju, Loss, Mundur, Langkah” gratis dibaca di sini di web. Untuk praktiknya secara interaktif (editor kode bawaan dan tutor AI 24/7) dan buka sisa kursus Deep Learning Academy, upgrade ke CoddyKit PRO. Kursus Deep Learning Academy mencakup 4 pelajaran total.

Apa yang akan aku pelajari di “Lintasan Maju, Loss, Mundur, Langkah”?

Empat langkah dalam satu iterasi pelatihan Kamu berlatih Deep Learning Academy dengan kode praktik yang langsung kamu jalankan di browser, dan tutor AI 24/7 menjawab pertanyaanmu saat kamu mengerjakan pelajaran ini.

Apakah aku perlu pengalaman untuk memulai Deep Learning Academy?

Tidak diperlukan pengalaman sebelumnya. Deep Learning Academy di CoddyKit dirancang untuk pemula hingga pelajar tingkat lanjut, jadi kamu bisa memulai di sini atau dari awal dan belajar sesuai kecepatan kamu sendiri. Ini adalah pelajaran 1 dari 4.

Berapa lama pelajaran “Lintasan Maju, Loss, Mundur, Langkah” memakan waktu?

Sebagian besar pelajaran CoddyKit memakan waktu sekitar 5–10 menit. Setiap pelajaran ringkas dan interaktif, jadi kamu membuat kemajuan stabil dan melanjutkan dari tempat kamu tinggalkan di web dan aplikasi.

Bisakah aku menulis dan menjalankan kode dalam pelajaran Deep Learning Academy ini?

Ya. Setiap pelajaran Deep Learning Academy menyertakan editor kode bawaan, jadi kamu menulis dan menjalankan kode nyata langsung di browser dan mendapatkan umpan balik AI instan — tidak diperlukan penyiapan lokal.

Semua pelajaran dalam kursus ini

  1. Lintasan Maju, Loss, Mundur, Langkah
  2. Tulis Siklus Pelatihan Minimal
  3. Lacak Akurasi Selama Pelatihan
  4. Mode Train vs Eval
← Kembali ke Deep Learning Academy