Enrollments Open for Online Instructor-Led Training for Big Data Engineering and Machine Learning | Use Coupon END15 for Extra 15% Off

  Enroll Now

Building the Network

We shall now build the classification network, with a hidden layer(with 30 neurons and selu activation function) and an output layer( with 1 neuron since we have to predict only one value).

We shall also specify the loss function we have defined - the huber_fn and the optimizer to use, while compiling.

Note:

  • kernel_initializer defines the way to set the initial random weights of Keras layers.
INSTRUCTIONS
  • Set "selu" as the activation and "lecun_normal" as the kernel_initializer for the following model.

    model = keras.models.Sequential([
        keras.layers.Dense(30, activation=<< your code comes here >>, 
           kernel_initializer=<< your code comes here >>, 
           input_shape=X_train.shape[1:]),
        keras.layers.Dense(1),
    ])
    
  • Compile the model using compile.

    • Set loss to be huber_fn which is the custom loss function we defined

    • We will be using "nadam" optimizer and "mae" metric.

      model.<< your code comes here >>(loss=<< your code comes here >>, optimizer="nadam", metrics=["mae"])
      

No hints are availble for this assesment

Answer is not availble for this assesment


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

Loading comments...