Функция потерь как ландшафт для спуска
Представьте ошибку в виде холмов и долин
«Функция потерь как ландшафт для спуска» — бесплатный урок Deep Learning Academy на CoddyKit. Это урок 1 из 4. Ты можешь прочитать весь урок бесплатно ниже — а потом практиковать его прямо в браузере с встроенным редактором кода и ИИ-репетитором 24/7. Это часть пути обучения 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) ** 2Two 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. 🏔️
Изучай Python с ИИ-репетитором — бесплатно
Пиши и запускай код прямо в браузере, получай мгновенную помощь от ИИ-репетитора 24/7 и продолжи учиться на сайте или в приложении.
- Курсы
- 30
- Уроки
- 120
Часто задаваемые вопросы
Урок «Функция потерь как ландшафт для спуска» бесплатный?
Да — полный текст урока «Функция потерь как ландшафт для спуска» бесплатно доступен здесь в веб-версии. Чтобы практиковать его интерактивно (встроенный редактор кода и ИИ-репетитор 24/7) и разблокировать остальной курс Deep Learning Academy, подпишись на CoddyKit PRO. Курс Deep Learning Academy содержит 4 уроков всего.
Чему я научусь в уроке «Функция потерь как ландшафт для спуска»?
Представьте ошибку в виде холмов и долин Ты практикуешь Deep Learning Academy с помощью реального кода, который запускаешь прямо в браузере, и ИИ-репетитор 24/7 отвечает на твои вопросы во время урока.
Нужен ли мне опыт, чтобы начать Deep Learning Academy?
Предыдущий опыт не требуется. Deep Learning Academy на CoddyKit структурирован для всех уровней — от новичков до продвинутых, поэтому ты можешь начать отсюда или с самого начала и учиться в своем темпе. Это урок 1 из 4.
Сколько времени занимает урок «Функция потерь как ландшафт для спуска»?
Большинство уроков CoddyKit занимают около 5–10 минут. Каждый из них компактный и интерактивный, поэтому ты постоянно делаешь прогресс и продолжаешь с того же места в веб-версии и приложении.
Можно ли писать и запускать код в этом уроке Deep Learning Academy?
Да. Каждый урок Deep Learning Academy включает встроенный редактор кода, поэтому ты пишешь и запускаешь реальный код прямо в браузере и получаешь моментальную обратную связь от AI — локальная установка не требуется.
Все уроки этого курса
- Функция потерь как ландшафт для спуска
- Градиенты указывают вверх — поэтому двигайтесь в обратную сторону
- Скорость обучения: слишком большая, слишком малая или оптимальная
- Минимизируйте функцию вручную в Python