Output layers
Output layers are simply Dense layers! Output layers are used to reduce the dimension of the inputs to the dimension of the outputs. You'll learn more about output dimensions in chapter 4, but for now, you'll always use a single output in your neural networks, which is equivalent to Dense(1) or a dense layer with a single unit.
Questo esercizio fa parte del corso
Advanced Deep Learning with Keras
Istruzioni dell'esercizio
- Import the
InputandDensefunctions fromkeras.layers. - Create an input layer of shape 1.
- Again, create a dense layer with 1 unit and pass
input_tensordirectly to it.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# Load layers
____
# Input layer
input_tensor = ____(shape=(____,))
# Create a dense layer and connect the dense layer to the input_tensor in one step
# Note that we did this in 2 steps in the previous exercise, but are doing it in one step now
output_tensor = ____(____)(____)