Project- Iris Flowers Classification using Deep Learning & Keras

8 / 17

Keras Project - Iris Flower Identification - Create the Model in Keras

Here we will create the Deep Learning model using Keras.

INSTRUCTIONS
  • Clear the Keras backend using the clear_session() function, and set the random seed values for Numpy and Tensorflow

    keras.backend.<< your code goes here >>()
    np.random.seed(42)
    tf.random.set_seed(42)
    
  • We will use the Sequential API to create the model. The model will consists of 7 layers in the following order: Dense/Input, Dropout, Dense, Dropout, Dense, Dropout with relu activation function, and 300, 100, 500 neurons in the 3 Dense layers respectively. The final layer would be a Dense layer with softmax activation function and 3 neurons for the output

    model = keras.models.Sequential([
        keras.layers.Dense(<< your code goes here >>, input_shape=(4,), activation="relu"),
        keras.layers.Dropout(rate=0.2),
        keras.layers.Dense(<< your code goes here >>, activation="relu", kernel_initializer="he_normal"),
        keras.layers.<< your code goes here >>(rate=0.2),
        keras.layers.Dense(<< your code goes here >>, activation="relu", kernel_initializer="he_normal"),
        keras.layers.<< your code goes here >>(rate=0.2),
        keras.layers.Dense(3, activation=<< your code goes here >>)
    ])
    
Get Hint See Answer


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...