Hello nets!
You're going to build a simple neural network to get a feeling of how quickly it is to accomplish this in Keras.
You will build a network that takes two numbers as an input, passes them through a hidden layer of 10 neurons, and finally outputs a single non-constrained number.
A non-constrained output can be obtained by avoiding setting an activation function in the output layer. This is useful for problems like regression, when we want our output to be able to take any non-constrained value.
Cet exercice fait partie du cours
Introduction to Deep Learning with Keras
Instructions
- Import the 
Sequentialmodel fromtensorflow.keras.modelsand theDenselayer fromtensorflow.keras.layers. - Create an instance of the 
Sequentialmodel. - Add a 10-neuron hidden 
Denselayer with aninput_shapeof two neurons. - Add a final 1-neuron output layer and summarize your model with 
summary(). 
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Import the Sequential model and Dense layer
from tensorflow.keras.____ import ____
from tensorflow.keras.____ import ____
# Create a Sequential model
model = ____
# Add an input layer and a hidden layer with 10 neurons
model.add(Dense(____, input_shape=(____,), activation="relu"))
# Add a 1-neuron output layer
model.add(____)
# Summarise your model
model.____