Now we will build the model using the Keras functional API. As we saw before, first we have to define the input:
InputModel = Input(shape=(784,))
This returns a tensor that represents our input placeholder. Later, we will use this placeholder to define a Model. At this point, we can add layers to the architecture of our model:
EncodedLayer = Dense(32, activation='relu')(InputModel)
The Dense class is used to define a fully connected layer. We have specified the number of neurons in the layer as the first argument (32), the activation function using the activation argument (relu), and finally the input tensor (InputModel) of the layer.