MNIST classification using binary neural nets in pytorch. Made for LAB2 of Hardware AI of TUDelft
- Install Conda in your computer to manage the python environment from here.
- Verify installation was succesful by issuing
conda list
in the terminal. - Create a new environment with
conda create -n binary_net python=3.9
, where binary_net is the name of your environment. - Activate enviroment with
conda activate binary_net
- Install pytorch and torchvision with with
pip3 install torch torchvision
. - Install juppyter notebook in your environment with
conda install jupyter
. - Install matplotlib with
conda install -c conda-forge matplotlib
. - You should now be able to use jupyter notebook without having issue with libraries.
- Lunch the notebook with
jupyter notebook
. - We will work on the file called our_network.ipynb. `
Files below are the weights for a 4 layer network with 2 hidden layer considered as baseline (you can find them in /baseline)
W_fc1.csv -> input layer (IN=784,OUT=100)
W_fc2.csv -> hidden1 layer (IN=100,OUT=100)
W_fc3.csv -> hidden2 layer (IN=100,OUT=100)
W_fc4.csv -> output layer (IN=100,OUT=10)
input_image_flatten.csv -> input image (ROW=1,COL=784)
With this files we should be able to validate that our machine can classify the image of number 2. This is verified in software.