Aan de slagGa gratis aan de slag

Lookup both inputs in the same model

Now that you have a team strength model and an input layer for each team, you can lookup the team inputs in the shared team strength model. The two inputs will share the same weights.

In this dataset, you have 10,888 unique teams. You want to learn a strength rating for each team, such that if any pair of teams plays each other, you can predict the score, even if those two teams have never played before. Furthermore, you want the strength rating to be the same, regardless of whether the team is the home team or the away team.

To achieve this, you use a shared layer, defined by the re-usable model (team_strength_model()) you built in exercise 3 and the two input layers (team_in_1 and team_in_2) from the previous exercise, all of which are available in your workspace.

Deze oefening maakt deel uit van de cursus

Advanced Deep Learning with Keras

Cursus bekijken

Oefeninstructies

  • Lookup the first team ID in the team strength model.
  • Lookup the second team ID in the team strength model.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Lookup team 1 in the team strength model
team_1_strength = ____

# Lookup team 2 in the team strength model
team_2_strength = ____
Code bewerken en uitvoeren