AndrewCarterUK / mnist-neural-network-plain-c

A neural network implementation for the MNIST dataset, written in plain C
92 stars 22 forks source link

Expected result doesn't match. #5

Open Eyxxxxx opened 3 years ago

Eyxxxxx commented 3 years ago

Hello. I just started learning the neural network and I am trying to implement a simple CNN in C language when I found your contribution. My problem is my result is slightly different from the one you gave out in the Readme.md. I simply download your project and compile it with the order gcc mnist.c mnist_file.c neural_network.c -lm -o mnist in Clion terminal. Here is my result. 1 Thanks for your time!

Eyxxxxx commented 3 years ago

Actually the final accuracy is close to 91%. I attached the complete output in the xlsx format. original data.xlsx

I was wondering if I did anything wrong? (I am trying to add some hidden layers based on your codes, so I want to make sure there isn't any mistakes from the start.

Thanks for your time again!

AndrewCarterUK commented 3 years ago

The network is initialised with random weights. Although the the random number generator isn't seeded (I don't call srand(...)), it's likely these weights differ between platforms.

As long as you reach the same accuracy and your training evolution graph looks similar, the program is working fine :)