LoslegenKostenlos loslegen

Loss functions in TensorFlow

In this exercise, you will compute the loss using data from the King County housing dataset. You are given a target, price, which is a tensor of house prices, and predictions, which is a tensor of predicted house prices. You will evaluate the loss function and print out the value of the loss.

Diese Übung ist Teil des Kurses

Introduction to TensorFlow in Python

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# 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())
Code bearbeiten und ausführen