더북(TheBook)
model = Sequential()
model.add(Dense(512, input_shape=(784,)))
model.add(Activation('relu'))
model.add(Dense(256))
model.add(Activation('relu'))
model.add(Dense(10))
model.add(Activation('softmax'))
model.summary()

실행 결과

Model: "sequential"
_________________________________________________________________
Layer (type)               Output Shape      Param #
=================================================================
dense (Dense)               (None, 512)      401920
_________________________________________________________________
activation (Activation)     (None, 512)     0
_________________________________________________________________
dense_1 (Dense)             (None, 256)      131328
_________________________________________________________________
activation_1 (Activation)   (None, 256)     0
_________________________________________________________________
dense_2 (Dense)             (None, 10)      2570
_________________________________________________________________
activation_2 (Activation)   (None, 10)     0
=================================================================
Total params: 535,818
Trainable params: 535,818
Non-trainable params: 0

그럼 코드가 의미하는 내용이 무엇인지 한 줄씩 살펴보겠습니다.

신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.