Mnist SGD trainer and evaluation

Mnist SGD trainer and evaluation

by Avery Lemons -
Number of replies: 0

There's several things to keep in mind when using this:

1. Have pip installed. Look through the code for any import statements that mention libraries you don't have, and download them. It's very easy using pip, don't worry. For instance to download numpy, go to your computer's command line, and type: python -m pip install numpy

2. The first line of the code is defining MAIN_PATH to be the path of the folder that I want my files to save to. Get the path of the folder you want your own models and figures saved to, and replace that string with your desired path.

3. You may comment out plt.savefig functions if you don't want to save specific figures. You may also change the names of the files to be saved by changing the text in the plt.savefig functions.

4. There's a commented-out line that trains your model, and there's another commented-out line below it that saves that model. These of course need to be commented-out or not depending on what you want to do with the code. Same goes for the line that loads a model, which is currently uncommented.

5. You may want to test a model against the training set, or against the testing set. It's currently set up to test against the training set. To make it test against the testing set, all instances of the word 'train' need to be replaced with the word 'test', below a point in the code with a marking saying such.

I would love to know of any improvements that are made to this :)