My model can't train without batchnorm

kjy13955: <p>hello, i want to make mcldnn model in this git hub : <a href="https://github.com/wzjialang/MCLDNN/blob/master/MCLDNN.py" rel="noopener nofollow ugc">https://github.com/wzjialang/MCLDNN/blob/master/MCLDNN.py</a></p>
<p>but the same model I made is not train without batch norm and even though use batch norm, accuracy is decrease</p>
<p>this is my mcldnn model:</p>
<p>sequence_length = 1<br>
input_size = 124<br>
hidden_size = 124<br>
num_layers = 1<br>
num_classes = 11<br>
batch = 400<br>
num_epochs = 2<br>
learning_rate = 0.001<br>
drop = 0.6<br>
class RNN(nn.Module):<br>
def <strong>init</strong>(self, input_size, hidden_size, num_layers, num_classes):<br>
super(RNN, self).<strong>init</strong>() #</p>
<pre><code>    self.conv1 = nn.Conv2d(1,50,(2,8))
    self.conv2 = nn.Conv1d(1,50,8)
    self.conv3 = nn.Conv1d(1,50,8)
    self.conv4 = nn.Conv2d(50,50,(2,8))
    self.conv5 = nn.Conv2d(100,100,(2,5))

    self.bn1 = nn.BatchNorm2d(50)
    self.bn2 = nn.BatchNorm1d(50)
    self.bn3 = nn.BatchNorm1d(50)
    self.bn4 = nn.BatchNorm2d(50)
    self.bn5 = nn.BatchNorm2d(100)

    self.drop1 = nn.Dropout(drop)
    self.drop2 = nn.Dropout(drop)
    self.drop3 = nn.Dropout(drop)
    self.drop4 = nn.Dropout(drop)
    self.drop5 = nn.Dropout(drop)

    
    self.hidden_size = hidden_size
    self.num_layers = num_layers
    self.lstm1 = nn.LSTM(input_size, hidden_size, num_layers,bidirectional=False, batch_first=True)
</code></pre>
<h1><a name="selfrelu5-nnrelu-1" class="anchor" href="#selfrelu5-nnrelu-1"></a>self.relu5 = nn.ReLU()</h1>
<pre><code>    self.lstm2 = nn.LSTM(124, hidden_size, num_layers,bidirectional=False, batch_first=True)
    
    self.fc1 = nn.Linear(124,128)
    self.fc2 = nn.Linear(128,128)
    self.fc3 = nn.Linear(128,11)

def forward(self, x): 
    input_ = torch.reshape(x,(x.size(0),1,x.size(1),x.size(2)))

    input_I = input_[:,:,0,:]
    input_Q = input_[:,:,1,:]
    input_I = torch.reshape(input_I,(x.size(0),1,x.size(2)))
    input_Q = torch.reshape(input_Q,(x.size(0),1,x.size(2)))
    
    input_ = F.pad(input_, (0,7,0,1))
    x1 = self.conv1(input_)
    x1 = self.bn1(x1)
    x1 = F.relu(x1)
    x1 = self.drop1(x1)

    input_I = F.pad(input_I, (0,7))
    x2 = self.conv2(input_I)
    x2 = self.bn2(x2)
    x2 = F.relu(x2)
    x2 = self.drop2(x2)

    input_Q = F.pad(input_Q, (0,7))
    x3 = self.conv3(input_Q)
    x3 = self.bn3(x3)
    x3 = F.relu(x3)
    x3 = self.drop3(x3)

    x2 = torch.reshape(x2,(x2.size(0),x2.size(1),1,x2.size(2)))
    x3 = torch.reshape(x3,(x3.size(0),x3.size(1),1,x3.size(2)))

    cat1 = torch.cat((x2,x3),2)
    cat1 = F.pad(cat1, (0,7,0,1))
    cat1 = self.conv4(cat1)
    cat1 = self.bn4(cat1)
    cat1 = F.relu(cat1)
    cat1 = self.drop4(cat1)

    cat2 = torch.cat((cat1,x1),1)
</code></pre>
<h1><a name="cat2-fpadcat2-40-2" class="anchor" href="#cat2-fpadcat2-40-2"></a>cat2 = F.pad(cat2, (4,0))</h1>
<pre><code>    cat2 = self.conv5(cat2)
    cat2 = self.bn5(cat2)
    cat2 = F.relu(cat2)
    cat2 = self.drop5(cat2)

    cat2 = torch.reshape(cat2,(cat2.size(0),cat2.size(1),cat2.size(3)))
    out, _ = self.lstm1(cat2)
    out, _ = self.lstm1(out)
    out = out[:,-1,:]
    
    out = self.fc1(out)
    out = F.relu(out)
    out = self.fc2(out)
    out = F.relu(out)
    out = self.fc3(out)

    return out
</code></pre>