TensorFlow에서의 손실 함수
이 연습에서는 King County 주택 데이터셋을 사용해 손실을 계산해 봅니다. 타깃 price는 실제 주택 가격의 텐서이고, predictions는 예측한 주택 가격의 텐서입니다. 손실 함수를 계산하고 손실 값을 출력하세요.
이 연습은 강의의 일부입니다
Python으로 시작하는 TensorFlow
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# 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())