モデルのコンパイル
この演習はコースの一部です
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)