Normalice y estandarice las entradas
Escale las características para que el entrenamiento converja
Normalice y estandarice las entradas es una lección gratuita de Deep Learning Academy en CoddyKit. Esta es la lección 4 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.
Raw Numbers Slow Learning
Features on wildly different scales, like age and salary, confuse a network. Rescaling them first is why normalization makes training converge faster. ⚖️
Two Common Recipes
You will meet two main scalers: standardization shifts data to mean zero and unit variance, while min-max squeezes it into a fixed range like 0 to 1.
Standardize with Mean and Std
Standardization subtracts the mean and divides by the standard deviation. The result is centered on zero with a spread of one, the deep learning default.
x = (x - x.mean()) / x.std()Min-Max Scaling
Min-max scaling maps your smallest value to 0 and largest to 1. It is handy when a bounded input range matters, like pixel intensities.
x = (x - x.min()) / (x.max() - x.min())Fit on Train Only
Compute the mean and std from the training set only. Reusing test data to set these stats leaks information and inflates your scores.
Reuse the Same Stats
Apply the exact training statistics to validation and test data. Both splits must be transformed the same way or your model sees mismatched inputs.
x_val = (x_val - train_mean) / train_stdPer-Channel for Images
For images you normalize each color channel with its own mean and std. PyTorch ships transforms.Normalize to do exactly this in a pipeline.
transforms.Normalize(mean=[0.5], std=[0.5])Borrow Known ImageNet Stats
When using pretrained vision models, normalize with the ImageNet means and stds they were trained on. Matching those numbers keeps inputs in the expected range.
Do It Inside __getitem__
The cleanest spot to scale is your dataset's __getitem__ or a transform. Then every sample arrives normalized without extra code in your training loop.
Watch for Divide by Zero
If a feature is constant its std is zero and dividing explodes. Add a tiny epsilon to the denominator to keep the math safe and stable.
x = (x - mean) / (std + 1e-8)Small Step, Big Payoff
Normalizing inputs is a quick preprocessing habit, yet it often unlocks faster, more stable training. Skip it and even a good model may crawl.
Quick Check
From which split should you compute normalization statistics?
Recap
Normalization rescales features so training converges, using stats fit on the training set and reused everywhere, often inside a transform. 🎉
Preguntas frecuentes
¿La lección «Normalice y estandarice las entradas» es gratis?
Sí — el texto completo de «Normalice y estandarice las entradas» 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 «Normalice y estandarice las entradas»?
Escale las características para que el entrenamiento converja 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 4 de 4.
¿Cuánto tiempo toma la lección «Normalice y estandarice las entradas»?
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
- Escriba una clase Dataset personalizada
- Agrupación en lotes, barajado y num_workers
- collate_fn para entradas de longitud variable
- Normalice y estandarice las entradas