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, monks-1.train and monks-1.test that has six attributes and binary class labels, please write python code for a jupyter notebook that satisfies the following.
1. Implement a three layer neural network, layer one 8 nodes snd a hyperbolic tangent activation function, layer two has 6 nofed snd a relu activation function, layer 3 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.
2. Use the cross entropy function as the loss function for logistic regression
3. Set the learning rate as 0.01 or change to other values if you find 0.01 is not suitable for this problem.
4. 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 2 layer neural network using keras with 12 nodes in hidden layer: from keras.models import Sequential from keras.layers import Dense model = Sequential()
model.add(Dense(12, input_dim=8, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='sgd')
model.fit(X,y)
 Using the monks data set, monks-1.train and monks-1.test that has six

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!