0Pricing
Deep Learning Academy · 课时

把损失看作可下降的地形

将误差想象成山丘与山谷

把损失看作可下降的地形 是 CoddyKit 上的免费 Deep Learning Academy 课时。 这是第 1 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 Deep Learning Academy 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 Deep Learning Academy 课程共包含 4 节课。

本课时的部分内容尚未翻译,以英文显示。

What Loss Measures

Your model's loss is a single number that says how wrong its predictions are. Smaller loss means better predictions. Training is just the quest to shrink it. 📉

Loss Depends on Weights

The same data gives different loss depending on your weights. Change a weight and the loss moves up or down. So loss is really a function of the weights.

loss = compute_loss(weights, data)

Picture a Landscape

Imagine every weight setting as a spot on a hilly landscape, and the height at that spot is the loss. Training means walking downhill to lower ground.

The Valley Is the Goal

The lowest point in this landscape is the minimum: the weights where your model predicts best. Your whole job is to reach that valley floor.

One Weight, a Simple Curve

With a single weight, the landscape is just a 2D curve. You can literally plot loss against the weight and see the dip where loss is smallest.

def loss(w):
    return (w - 3) ** 2

Two Weights, a Surface

Add a second weight and the curve becomes a 3D surface with hills and valleys. Real models have millions of weights, so the landscape lives in millions of dimensions.

You Can't See It All

In high dimensions you can never view the whole landscape at once. You only feel the slope right under your feet and step accordingly.

Steep vs Flat Ground

A steep slope means loss changes fast here, so a small step helps a lot. Flat ground means you are near a valley or a plateau and progress slows.

Not Every Valley Is the Best

The landscape can have many dips. A local minimum is a small valley that traps you above the deepest one. Deep nets usually still train well anyway.

Descending the Landscape

The whole training algorithm is called gradient descent for a reason: you repeatedly step downhill on this loss landscape until you settle near the bottom.

Why the Metaphor Helps

Thinking of loss as terrain makes training intuitive: where am I, which way is down, and how big a step should I take? Every other idea builds on this picture.

Quick Check

Let's check the landscape picture.

Recap

Loss is a number that depends on your weights, so it forms a landscape of hills and valleys. Training means walking downhill toward the lowest loss you can find. 🏔️

常见问题解答

「把损失看作可下降的地形」课时是免费的吗?

是的 — 「把损失看作可下降的地形」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 Deep Learning Academy 课程的其余内容,请升级到 CoddyKit PRO。 Deep Learning Academy 课程共包含 4 节课。

「把损失看作可下降的地形」这节课中我会学到什么?

将误差想象成山丘与山谷 你通过在浏览器中直接运行的动手代码来练习 Deep Learning Academy,全天候 AI 导师会在你学习这节课的过程中回答你的问题。

学习 Deep Learning Academy 需要有经验吗?

无需任何先前经验。CoddyKit 上的 Deep Learning Academy 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 1 节课,共 4 节。

「把损失看作可下降的地形」课时需要多长时间?

大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。

我能在这节 Deep Learning Academy 课中编写并运行代码吗?

能。每节 Deep Learning Academy 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。

此课程中的所有课时

  1. 把损失看作可下降的地形
  2. 梯度指向上坡方向,因此请向反方向迈步
  3. 学习率:过大、过小还是恰到好处
  4. 用 Python 手动最小化函数
← 返回 Deep Learning Academy