Skip to content

Build a any-shape-you-like MLP model to classify digits on MNIST dataset. No use of ML framework (Tensorflow, PyTorch...), the goal is to understand deeply how training & inference work from scratch.

Notifications You must be signed in to change notification settings

poupeaua/digit-learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

digitLearning - Alexandre Poupeau

Using the MNIST database from Yann LeCun, elaborate a neural network model in order to identify digits made by hand. In this project, the backpropagation is done using a stochastic gradient descent technique. No machine learning library such as Tensorflow, Keras or sklearn is used in this project. The goal here is to deeply understand the mecanism of training a neural network without using any tool to do that for us.

HOW TO

  1. Create your own neural network model (OPTIONAL STEP): In the directory networks/model: you can create a network. You have to name it {network_name}.txt. The first line is the number of layer in the neural network (except the first one and the last one). For each layer (the number in the first line) return to a new line and write a number. This indicates the number of neurons in this layer. N.B: you are not obliged to create a new .txt file, you can simply use existing ones.

  2. Initialize your neural network: Simply run the following command in the main directory: ./main.py networks/model/{network_name}.txt -ls 1 -ts 1 -init=S networks/saved/{dir_name}

  3. Train and save: In order to train your neural network, run the following command: ./main.py networks/saved/{dir_name} -ls NB -ts NB -S You can choose to not save the training by deleting the -S argument.

  4. Follow the evolution of your training: Just open the file networks/saved/{dir_name}/info.csv. It contains all the information about the evolution of your neural network.

  5. Enjoy ! In case of emergency do not hesitate to run the command ./main.py using one of the following argument: ["help", "-help", "--help", "h", "-h", "--h", "HELP", "-HELP", "--HELP" "H", "-H", "--H", "MORE", "-MORE", "--MORE", "more", "-more", "--more"] This will give you some indications for how to use all the arguments.

Documentation

For further information and to get a better understanding of the code I recommend you to read either doc/html/index.html or doc/latex/refman.pdf.

About

Build a any-shape-you-like MLP model to classify digits on MNIST dataset. No use of ML framework (Tensorflow, PyTorch...), the goal is to understand deeply how training & inference work from scratch.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages