What are wrong in the figures?

twpann: <p>I want to know what are wrong in the plotted diagrams.They are train loss and validation loss.If it is informal,please answer how can I solve the problem.Thanks in advance!![loss|640x476](upload://rqPczFdZ8naAVCLpj9kTtKB0fS<img src="https://discuss.pytorch.org/uploads/default/original/3X/5/7/5708e2eab66adea431a39705a8203f655e55e9c2.png" alt="loss1" data-base62-sha1="cpWzTrFJ7h72vEfXAvKqAkdTqnM" width="640" height="476"> t.png)</p>

ptrblck: <p>The figure shows noisy losses and indicates that your model is not training.<br>
Generally, if you are stuck and your training isn’t working properly, I would recommend to start by overfitting a small dataset, e.g. just 10 samples, and make sure it’s working fine by playing around with hyperparameters.</p>

twpann: <p>Thanks for answering!</p>

twpann: <p>Please explain that model is not training.How can I overfit small dataset.Thanks a lot in advance!</p>

pchandrasekaran: <p>The model is not training since the graph shows the loss is not decreasing, and the goal of a ML model is to minimize the loss between the actual and predicted values. If the model were training correctly, you would see a decrease in the loss as the epochs go up (it may still be a bit noisy, but it will be a notable decrease).</p>
<p>Onto the overfitting part, say you have 10000 samples. Use only 100 of them and train your model on that subset. Play around with number of hidden layers, number of neurons in each layer, different optimizers (and their parameters) until you can achieve near perfect accuracy. The reply to this <a href="https://stats.stackexchange.com/questions/352036/what-should-i-do-when-my-neural-network-doesnt-learn" rel="noopener nofollow ugc">question</a> gives a comprehensive in-depth explanation.</p>

twpann: <p>Thanks a lot for explaining!</p>

twpann: <p>If I use deep learning and samples are only about 2000,what parameters should be played.Does the figure improve slightly or not.Thanks a lot in advance!<img src="https://discuss.pytorch.org/uploads/default/original/3X/f/a/fa3fcf3cffbadd8dce66fbd0778c7e744b97a404.png" alt="loss" data-base62-sha1="zHO4Tfed6rMzjdhZMm3ePxqVAwY" width="640" height="476"></p>

pchandrasekaran: <p>No, your model still isn’t learning. The loss is still extremely noisy. The parameters that you can look into are:</p>
<ol>
<li>Number of Hidden Layers.</li>
<li>Number of Neurons in the Hidden Layers.</li>
<li>Batch Sizes.</li>
<li>Add Dropout Layers in the Network</li>
<li>Optimizers (and their parameters like learn rate, weight decay, etc).</li>
</ol>
<p>Do all of the above only on the small subset of data. The goal is to overfit the model on this tiny batch.</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/a/f/af9732a90748a067458ea1b0382de42068ac5502.png" data-download-href="https://discuss.pytorch.org/uploads/default/af9732a90748a067458ea1b0382de42068ac5502" title="Losses"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/a/f/af9732a90748a067458ea1b0382de42068ac5502_2_292x500.png" alt="Losses" data-base62-sha1="p3luPGGlnJEUQeuVBFIuMWV78Ai" width="292" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/a/f/af9732a90748a067458ea1b0382de42068ac5502_2_292x500.png, https://discuss.pytorch.org/uploads/default/optimized/3X/a/f/af9732a90748a067458ea1b0382de42068ac5502_2_438x750.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/a/f/af9732a90748a067458ea1b0382de42068ac5502_2_584x1000.png 2x" data-dominant-color="FBFBFC"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Losses</span><span class="informations">1465×2507 190 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>I’ve attached an image from one of my projects. As you can see, it is still noisy, but there is a definite decrease. This is the kind of curve you should expect.</p>

twpann: <p>Thanks a lot for answering!!</p>