IniziaInizia gratis

Model using two inputs and one output

Now that you have your two inputs (team id 1 and team id 2) and output (score difference), you can wrap them up in a model so you can use it later for fitting to data and evaluating on new data.

Your model will look like the following diagram:

Questo esercizio fa parte del corso

Advanced Deep Learning with Keras

Visualizza il corso

Istruzioni dell'esercizio

  • Define a model with the two teams as inputs and use the score difference as the output.
  • Compile the model with the 'adam' optimizer and 'mean_absolute_error' loss.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Imports
from tensorflow.keras.layers import Subtract
from tensorflow.keras.models import Model

# Subtraction layer from previous exercise
score_diff = Subtract()([team_1_strength, team_2_strength])

# Create the model
model = ____([____, ____], ____)

# Compile the model
____(____, ____)
Modifica ed esegui il codice