I am currently trying to reimplement a softmax regression to classify MNIST handwritten digits. I not a machine learner and my plan was to get an intuition of the entire workflow that has to be developed to learn a model. So I wrote a simple C++ program that optimize the following probabilistic model
$$ P(i|x) = \frac{\exp\left(w_i^T x + b_i\right)}{\sum_{i=1}^k\exp\left(w_j^T x + b_j\right)}$$ where $i,j=0,\dots,9$ are the $k=9$ classes for the handwritten digits, $w_i,x\in \mathbb{R}^{748}$ and $b_j\in \mathbb{R}$. As objective function I made use of $$ \mathcal L (D;W,b) = -\frac{1}{|D|}\sum_{(i,x)\in D} \ln P(i|x)~, $$ where $D$ is the entire training sample. To minimize the $\mathcal L$, I used mini-batch stochastic gradient descent with the derivatives
$$ \frac{\partial}{\partial w_{nl}} \ln P(i|x) = x_l\left(\delta_{i,n} - P(n|x)\right)$$
$$ \frac{\partial}{\partial b_{n}} \ln P(i|x) = \delta_{i,n} - P(n|x)$$ where I introduced the Kronecker-delta $\delta_{i,n}$ which is 1 if $i=n$ and 0 otherwise. Here begins my question. MNIST handwritten digits have 70 K samples, I used 10 K for testing (which I never reached) 6K for Validation and the remaining 54K for training. To train the model I used minibatch stochastic gradient descent with batch-size 200 and update equation $$ w_{nl}^{(t)} = w_{nl}^{(t-1)} - \frac{\eta}{|B|} \sum_{(i,x)\in B} x_l\left(\delta_{i,n} - P(n|x)\right)$$ and $$ b_{n}^{(t)} = b_{n}^{(t-1)}- \frac{\eta}{|B|} \sum_{(i,x)\in B} \left(\delta_{i,n} - P(n|x)\right) $$ where $B$ is the current batch and the learning rate was take to be 0.1. When I trained the model I achieved an accuracy of 60-70 % before the model some how collapses. Meaning that probabilities of trainings samples become zero such that the log-likelihood becomes infinite. I played a lot around with different batch size and learning rates, but where not able to figure out my mistake. Moreover, I implemented an adaptive learning rate as shown below. However,it did not help to solve the problem.
For illustrating purpose I generated two plots of the log-likelihood and Accuracy and learning rate for a batch size of 200 samples. It is worth mentioning that I did not include the collapse in the plot. The next value of the curve was infinite.