모델 컴파일하기
이 연습은 강의의 일부입니다
Python으로 시작하는 Deep Learning
연습 안내
model.compile()을 사용해 모델을 컴파일하세요.optimizer는'adam',loss는'mean_squared_error'로 지정해야 합니다.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Import necessary modules
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Sequential
# Specify the model
n_cols = predictors.shape[1]
model = Sequential()
model.add(Dense(50, activation='relu', input_shape = (n_cols,)))
model.add(Dense(32, activation='relu'))
model.add(Dense(1))
# Compile the model
____
# Verify that model contains information from compiling
print("Loss function: " + model.loss)