TensorFlow における損失関数
この演習では、King County の住宅データセットを使って損失を計算します。住宅価格のテンソルであるターゲット price と、予測された住宅価格のテンソル predictions が与えられています。損失関数を評価し、損失の値を出力してください。
この演習はコースの一部です
Introduction to TensorFlow in Python
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# Import the keras module from tensorflow
____
# Compute the mean squared error (mse)
loss = keras.losses.____(price, predictions)
# Print the mean squared error (mse)
print(loss.numpy())