C.W.K.
Stream
Lesson 04 of 07 · published

Fine-tuning

~8 min · transfer

Level 0Keras 도제
0 XP0/97 lessons0/20 achievements
0/120 XP to next level120 XP to go0% complete

Feature extraction 후 추가 단계 — backbone 의 *일부 layer* 도 학습 가능하게 풀고, *매우 낮은* learning rate (1e-5 ~ 1e-4) 로 학습. 이때 backbone freeze 해제는 *위쪽 layer 부터* — 일반적 feature 는 그대로, task-specific 만 조정.

예: for layer in backbone.layers[:-50]: layer.trainable = False — 마지막 50 layer 만 풀기. compile 다시 (trainable 변경 후 필수). 그 후 또 fit.

백엔드 노트:
⚙️ Backend Note

Code

# Unfreeze the top layers of the base model
base_model.trainable = True

# Freeze everything except the top 20 layers
for layer in base_model.layers[:-20]:
    layer.trainable = False

# CRITICAL: Re-compile with a very low learning rate
model.compile(
    optimizer=keras.optimizers.Adam(1e-5),  # 100x lower!
    loss="categorical_crossentropy",
    metrics=["accuracy"],
)

# Continue training (~10-20 more epochs)
model.fit(train_ds, epochs=20, validation_data=val_ds)

External links

Exercise

feature-extraction 모델 가져와. backbone 마지막 30 layer 풀어. learning_rate=1e-5 로 재 compile. 3 epoch 더 학습. fine-tune 전후 validation accuracy 비교.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.