Professional Documents
Culture Documents
KMPA Assignment-I: 1 Classification
KMPA Assignment-I: 1 Classification
KMPA Assignment-I
Group No. 11
Vindhani Mohsin (ED11B041), Rohit R. Salunke (ME11B119), Pritesh Jain (ME11B116)
March 3, 2016
Classification
For all the classification task, the selected error function is Cross-Entropy error with the desired output
being 1 of K representation. The input is normalized by the algorithm before feeding in to the training.
The activation function of the last layer is Sigmoid to bound the outcome of the final layer in 0 to 1.
The model selection was done by running models with different hyper parameters subject to the same
learning algorithm with fixed parameters and fixed maximum number of epochs allowed.
Class 1
Class 2
Class 3
Accuracy
Confusion Matrix
Class 1
Class 2
100
0
0
100
0
0
100%
Class 3
0
0
100
Class 1
Class 2
Class 3
Accuracy
Confusion Matrix
Class 1
Class 2
60
0
0
120
0
0
100%
Class 3
0
0
160
Figure 7: Node 1 of layer 1 EpochFigure 8: Node 2 of layer 1 EpochFigure 9: Node 3 of layer 1 Epoch
1
1
1
Node 8 of layer 1
Node 8 of layer 2
Figure 23: Node 1 of output layerFigure 24: Node 2 of output layerFigure 25: Node 3 of output layer
Epoch 1
Epoch 1
Epoch 1
Node 8 of layer 1
Node 8 of layer 2
Figure 42: Node 1 of output layerFigure 43: Node 2 of output layerFigure 44: Node 3 of output layer
Epoch 2
Epoch 2
Epoch 2
Node 8 of layer 1
Node 8 of layer 2
Figure 61: Node 1 of output layerFigure 62: Node 2 of output layerFigure 63: Node 3 of output layer
Epoch 10
Epoch 10
Epoch 10
Node 8 of layer 1
10
Node 8 of layer 2
11
Figure 80: Node 1 of output layerFigure 81: Node 2 of output layerFigure 82: Node 3 of output layer
Epoch 50
Epoch 50
Epoch 50
Node 8 of layer 1
12
Node 8 of layer 2
Figure 99: Node 1 of output layerFigure 100: Node 2 of outputFigure 101: Node 3 of output layer
layer Epoch 100
Epoch 100
Epoch 100
13
Overlapping classes
It is not possible to obtain full accuracy and hence experiments were done to study the changes in the
accuracy and decision boundary by changing the model complexity.
The experiments done were:
(5,5,3)
(8,8,3)
(12,12,3)
where the first two numbers correspond to the number of neurons in the hidden layer 1 and hidden layer
2 respectively. The last number is the number of outputs.
On increasing the number of neurons, patches started coming up as shown in (12,12,3) and the
accuracy reduced. For the model (5,5,3) , the model could not achieve high accuracy as the complexity
was not enough so the model (8,8,3) is selected as the optimal.
Refer tables 3 and 4 and figures 102 and 103.
Class 1
Class 2
Class 3
Accuracy
Confusion
Class 1
131
7
4
Matrix
Class 2
14
140
8
90.8%
Class 3
5
3
138
Class 1
Class 2
Class 3
Accuracy
Confusion
Class 1
135
21
6
Matrix
Class 2
11
125
6
88.4%
Class 3
4
4
138
Image Data
Each data point has 48 features. The data was separated in to training(0.7), validation set(0.15) and
test set(0.15).
The experiments done were:
(10,10,5)
(15,15,5)
(20,20,5)
(25,25,5)
14
(30,30,5)
where the first two numbers correspond to the number of neurons in the hidden layer 1 and hidden layer
2 respectively. The last number is the number of outputs.
The accuracy of the model for (25,25,5) was better than (20,20,5) and (30,30,5). Hence it was selected.
15
Regression
16
Figure 108: Model complexity x2 . Regulariza-Figure 109: Model complexity x5 . Regularization=0. MSE=0.245
tion=0. MSE=0.125
17
Target Vs. Model output data plots for train data and validation data of Bivatariate dataset are
shown in figures 118 and 119. Refer figures 121, 122 and 123 for scatter plots with Target output on
x-axis and Model output on y-axis.
18
Figure 126: Model complexity K = 8. Regu-Figure 127: Model complexity K = 20. Regularization=0.5
larization=0.5
19
Figure 128: Model complexity K = 12. Regu-Figure 129: Model complexity K = 12. Regularization=0. MSE=206.92
larization=0.2. MSE=101.05
Figure 130: Model complexity K = 12. Regu-Figure 131: Model complexity K = 12. Regularization=0.5. MSE=106.80
larization=0.8. MSE=74.63
Target Vs. Model output data plots for test data and validation data of Bivariate dataset are shown
in figures 132 and 133. Refer figures 134, 135 and 136 for scatter plots with Target output on x-axis and
Model output on y-axis.
20
Target Vs. Model output data plots for train data and validation data of Univatariate dataset are
shown in figures 137 and 138. Refer figures 140, 141 and 142 for scatter plots with Target output on
x-axis and Model output on y-axis.
21
Validation
Test
Train
Train20
205.57
217.0553
3.820
Train Data
Train100
79.134
85.058
41.035
Train1000
98.29
99.696
89.696
Train 2000
120.28
118.380
129.4516
22
Figure 151:
Epoch 1
Figure 154:
Epoch 1
Node 4 of layer 1
23
Node 3 of layer 1
Figure 155:
Epoch 1
Figure 158:
Epoch 1
Figure 160:
Epoch 2
Figure 163:
Epoch 2
Node 4 of layer 1
24
Node 3 of layer 2
Node 3 of layer 1
Figure 164:
Epoch 2
Figure 167:
Epoch 2
Figure 169:
Epoch 10
Figure 172:
Epoch 10
Node 4 of layer 1
25
Node 3 of layer 2
Node 3 of layer 1
Figure 173:
Epoch 10
Figure 176:
Epoch 10
Figure 178:
Epoch 50
Figure 181:
Epoch 50
Node 4 of layer 1
26
Node 3 of layer 2
Node 3 of layer 1
Figure 182:
Epoch 50
Figure 185:
Epoch 50
Figure 187:
Epoch 5000
Figure 190:
Epoch 500
Node 4 of layer 1
27
Node 3 of layer 2
Node 3 of layer 1
Figure 191:
Epoch 500
Figure 194:
Epoch 500
Node 3 of layer 2
28
Figure 198: Model complexity K = 12. Regu-Figure 199: Model complexity K = 20. Regularization=0.8
larization=0.5
29
Figure 200: Model complexity K = 15. Regu-Figure 201: Model complexity K = 15. Regularization=0. MSE=694.55
larization=0.2. MSE=68.87
Figure 202: Model complexity K = 15. Regu-Figure 203: Model complexity K = 15. Regularization=0.5. MSE=73.4
larization=0.8. MSE=84
30
Target Vs. Model output data plots for test data and validation data of Bivariate dataset are shown
in figures 204 and 205. Refer figures 206, 207 and 208 for scatter plots with Target output on x-axis and
Model output on y-axis.
Target Vs. Model output data plots for train data and validation data of Univatariate dataset are
shown in figures 209 and 210. Refer figures 212, 213 and 214 for scatter plots with Target output on
x-axis and Model output on y-axis.
31
32