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

model.summary() 읽기

~8 min · sequential

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

model.summary() 가 model 의 X-ray. layer 이름, output shape, parameter 수, 그리고 trainable / non-trainable parameter 합계까지. CNN 빌드 후 첫 정신건강 확인이 이거.

shape 가 (None, 128) 이면 None 은 batch dim — 학습 시 채워짐. parameter 수 0 이면 weight 없는 layer (Flatten, Dropout). non-trainable 이 있으면 BatchNorm 의 moving stats 또는 frozen layer.

Code

model.summary()
# Output:
# ┏━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
# ┃ Layer (type)           ┃ Output Shape     ┃    Param # ┃
# ┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
# │ dense (Dense)          │ (None, 128)      │    100,480 │
# │ dropout (Dropout)      │ (None, 128)      │          0 │
# │ dense_1 (Dense)        │ (None, 10)       │      1,290 │
# └───────────────────────┴──────────────────┴────────────┘

External links

Exercise

Conv2D 2 개 + Dense 2 개로 CNN 짜. model.summary() 읽고 직접 계산해봐 — 각 Conv 의 parameter 수 = (kernel_h × kernel_w × in_channels + 1) × out_channels.

Progress

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

댓글 0

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

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