Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started