Question: Using the monks data set, monks - 1 . train and monks - 1 . test that has six attributes and binary class labels, please
Using the monks data set, monkstrain and monkstest that has six attributes and binary class labels, please write python code for a jupyter notebook that satisfies the following.
Implement a three layer neural network, layer one nodes snd a hyperbolic tangent activation function, layer two has nofed snd a relu activation function, layer has one node and a sigmoid activation function. Can use either the sequential and dense layer grom keras or sckit learn MLPClassifier or implement your own neural network function.
Use the cross entropy function as the loss function for logistic regression
Set the learning rate as or change to other values if you find is not suitable for this problem.
For the two optimizers: stochastic gradient descent and Adam, record the testing accuracy of these two optimizers with respect to the epochs number
An example of layer neural network using keras with nodes in hidden layer: from keras.models import Sequential from keras.layers import Dense model Sequential
model.addDense inputdim activation'relu'
model.addDense activation'sigmoid'
model.compileloss'binarycrossentropy', optimizersgd
model.fitXy
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
