Get startedGet started for free

Create an input layer with multiple columns

In this exercise, you will look at a different way to create models with multiple inputs. This method only works for purely numeric data, but its a much simpler approach to making multi-variate neural networks.

Now you have three numeric columns in the tournament dataset: 'seed_diff', 'home', and 'pred'. In this exercise, you will create a neural network that uses a single input layer to process all three of these numeric inputs.

This model should have a single output to predict the tournament game score difference.

This exercise is part of the course

Advanced Deep Learning with Keras

View Course

Exercise instructions

  • Create a single input layer with 3 columns.
  • Connect this input to a Dense layer with 1 unit.
  • Create a model with input_tensor as the input and output_tensor as the output.
  • Compile the model with 'adam' as the optimizer and 'mean_absolute_error' as the loss function.

Hands-on interactive exercise

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

# Create an input layer with 3 columns
input_tensor = ____((____,))

# Pass it to a Dense layer with 1 unit
output_tensor = ____(____)(____)

# Create a model
model = ____(____, ____)

# Compile the model
____.____(optimizer=____, loss=____)
Edit and Run Code