Los gradientes apuntan cuesta arriba: avance en sentido contrario
Use la pendiente para mejorar los pesos
Los gradientes apuntan cuesta arriba: avance en sentido contrario es una lección gratuita de Deep Learning Academy en CoddyKit. Esta es la lección 2 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de Deep Learning Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de Deep Learning Academy incluye 4 lecciones en total.
Partes de esta lección aún no han sido traducidas y se muestran en inglés.
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 - gradThe 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 * gradGradient 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 = -gradWhy 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. ⬇️
Preguntas frecuentes
¿La lección «Los gradientes apuntan cuesta arriba: avance en sentido contrario» es gratis?
Sí — el texto completo de «Los gradientes apuntan cuesta arriba: avance en sentido contrario» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de Deep Learning Academy, actualiza a CoddyKit PRO. El curso de Deep Learning Academy incluye 4 lecciones en total.
¿Qué aprenderé en «Los gradientes apuntan cuesta arriba: avance en sentido contrario»?
Use la pendiente para mejorar los pesos Practicas Deep Learning Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.
¿Necesito experiencia previa para empezar Deep Learning Academy?
No se requiere experiencia previa. Deep Learning Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 2 de 4.
¿Cuánto tiempo toma la lección «Los gradientes apuntan cuesta arriba: avance en sentido contrario»?
La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.
¿Puedo escribir y ejecutar código en esta lección de Deep Learning Academy?
Sí. Cada lección de Deep Learning Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.
Todas las lecciones de este curso
- La pérdida como un paisaje que recorrer hacia abajo
- Los gradientes apuntan cuesta arriba: avance en sentido contrario
- Tasa de aprendizaje: demasiado grande, demasiado pequeña o justa
- Minimice una función a mano en Python