Get startedGet started for free

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.

This exercise is part of the course

Advanced Deep Learning with Keras

View Course

Exercise instructions

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

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

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

# Lookup team 2 in the team strength model
team_2_strength = ____
Edit and Run Code