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

Sequential 이 뭐야?

~8 min · sequential

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

Keras hello-world. `keras.Sequential([layer, layer, layer])` 가 교과서 1페이지짜리고, 작거나 중간 사이즈 model 의 80% 는 진짜로 이 모양이야. 처음부터 만들어보고, MNIST classifier 돌려보고, 이 API 가 *부족해지는 시점* 도 정직하게 짚는다.

keras.Sequential 은 layer 들의 *linear stack*. 입력이 하나 → 첫 layer 통과 → 다음 → 다음 → ... → 출력. branch 도 없고, skip 도 없고, multiple input 도 없어. 이 단순함이 강점이자 한계야.

API 는 list 한 개: keras.Sequential([Dense(128), Dense(64), Dense(10)]). 또는 model.add(layer) 로 점진적 빌드. 일상의 fully-connected, 단순 CNN, RNN stack 다 이 모양이고 80% 의 일은 여기서 끝나.

Code

import keras
from keras import layers

# Method 1: Pass a list of layers
model = keras.Sequential([
    keras.Input(shape=(784,)),
    layers.Dense(128, activation="relu"),
    layers.Dense(64, activation="relu"),
    layers.Dense(10, activation="softmax"),
])

# Method 2: Incremental add()
model = keras.Sequential()
model.add(keras.Input(shape=(784,)))
model.add(layers.Dense(128, activation="relu"))
model.add(layers.Dense(10, activation="softmax"))

External links

Exercise

regression 용 3-layer Sequential MLP 짜. model.summary() 출력하고 각 layer 의 input/output shape 확인.

Progress

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

댓글 0

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

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