이제 모델을 다음과 같이 설정합니다. model.summary() 함수를 이용해 현재 설정된 모델의 구조를 살펴보겠습니다.
# 모델의 구조를 설정합니다. = Sequential() .add(Embedding(5000, 100)) .add(Dropout(0.5)) .add(Conv1D(64, 5, ='valid', ='relu', =1)) .add(MaxPooling1D( =4)) .add(LSTM(55)) .add(Dense(1)) .add(Activation('sigmoid')) .summary()
실행 결과는 다음과 같습니다.
실행 결과
_________________________________________________________________ Layer (type) Output Shape Param # ================================================================= embedding_1 (Embedding) (None, None, 100) 500000 _________________________________________________________________ dropout_1 (Dropout) (None, None, 100) 0 _________________________________________________________________ conv1d_1 (Conv1D) (None, None, 64) 32064 _________________________________________________________________ max_pooling1d_1 (MaxPooling1 (None, None, 64) 0 _________________________________________________________________ lstm_1 (LSTM) (None, 55) 26400 _________________________________________________________________ dense_1 (Dense) (None, 1) 56 _________________________________________________________________ activation_1 (Activation) (None, 1) 0 ================================================================= Total params: 558,520 Trainable params: 558,520 Non-trainable params: 0 _________________________________________________________________