cserajdeep / DNN-IRIS-PyTorch

Deep Neural Network with Batch normalization for tabulat datasets.

Repository from Github https://github.comcserajdeep/DNN-IRIS-PyTorchRepository from Github https://github.comcserajdeep/DNN-IRIS-PyTorch

Deep Neural Network

(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.

Heavy Neural Architecture (BN_DNN)

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)

Light-weight Neural Architecture (DNN_LITE)

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)

Batch Normalized DNN

About

Deep Neural Network with Batch normalization for tabulat datasets.

License:MIT License


Languages

Language:Jupyter Notebook 100.0%