@ptrblck, I ran the code many times and changed my batchsize, learning rates, activation functions, weight decay, l2 reg parameter but the problem lies in the fact that, the gradients are very small and the updates are not significant due to which the loss is not decreasing and hence no improvement in accuracy as a result of underfitting