0PricingLogin
Learn AI with Python · Lesson

Fine-tuning: Unfreezing and Retraining

base_model.trainable = True, layer-by-layer unfreezing, differential learning rates.

When to Fine-Tune

After feature extraction trains your head, fine-tuning squeezes out extra accuracy by letting the top of the pretrained base adapt to your data. Do it only once the head is stable, otherwise large gradients from a random head can damage the base.

Unfreezing the Base

Set base.trainable = True to make weights updatable again. By itself this unfreezes every layer, which is usually too aggressive.

base.trainable = True
print("Trainable layers:", sum(l.trainable for l in base.layers))

All lessons in this course

  1. Transfer Learning Concepts and Strategies
  2. Using VGG16 and ResNet50 as Base Models
  3. Fine-tuning: Unfreezing and Retraining
  4. MobileNet and EfficientNet for Edge Deployment
← Back to Learn AI with Python