$24
This assignment intends to test your understanding of Multilayer Perceptron concepts and how to apply it using Tensorflow/ Keras library.
Dataset generation
Use following code to generate the training and the testing dataset. This dataset is similar to XOR but have 3 classes. X_train and y_train are features and labels respectively for the training dataset. Similarly, X_test and y_test are features and labels for the testing dataset.
Task 1 – Visualize the complete dataset where samples belong to one class have same color. Show the legend and axes name as well.
Task 2 – Train a neural network with 2 hidden layers. Keep both hidden layers as dense (fully connected) layer.
Train it on 5 different settings.
Settings
Nodes in first hidden layer
Nodes in second hidden layer
Dropout
1st
10
10
0.1
2nd
20
30
0.1
3rd
50
50
0.8
4th
50
50
0.1
5th
100
100
0.5
Task 3 – For each setting, plot the decision boundary.
Task 4 – Show the training and testing results for each setting and also analyze the effect of changing the hidden layers and dropout on decision boundarys.
Hint :- Go through the following link to understand how to use Keras in TensorFlow environment. Keep the model.compile, model.fit and model.evaluate as it is.
https://www.tensorflow.org/tutorials/quickstart/beginner