(1) BN_DNN with 4 layers and 1 output layer. The model gives 100% test accuracy for Iris 7:3 split.
(2) DNN_LITE with 2 layers and 1 output layer. The model provides 91.11% test accuracy for same 7:3 split.
Model | Accuracy (%) | AUC | #Param |
---|---|---|---|
BN_DNN | 100 | 1.00 | 202,755 |
DNN_LITE | 91.11 | 0.978 | 2,953 |
Updated: 26-June-2021.
class BN_DNN(nn.Module):
"""Feedfoward neural network with 4 hidden layer"""
def __init__(self, in_size, out_size):
super().__init__()
# hidden layer 1
self.linear1 = nn.Linear(in_size, 256)
nn.BatchNorm1d(256) #applying batch norm
# hidden layer 2
self.linear2 = nn.Linear(256, 512)
nn.BatchNorm1d(512) #applying batch norm
# hidden layer 3
self.linear3 = nn.Linear(512, 128)
nn.BatchNorm1d(128) #applying batch norm
# hidden layer 4
self.linear4 = nn.Linear(128, 32)
nn.BatchNorm1d(32) #applying batch norm
# output layer
self.linear5 = nn.Linear(32, out_size)
class DNN_LITE(nn.Module):
def __init__(self, input_dim, out_dim):
super(DNN_LITE, self).__init__()
self.layer1 = nn.Linear(input_dim, 50)
nn.BatchNorm1d(50)
self.layer2 = nn.Linear(50, 50)
nn.BatchNorm1d(50)
self.layer3 = nn.Linear(50, out_dim)