r/learnmachinelearning • • 32m ago

Help MNIST training time optimization, please help

Hey there, my long term goal is to make a OCR and i have started ML a few months back, 3 days ago i started to make a CNN for the MNIST data set (60k training images and 10k test images) i achieved an accuracy of 92.20% but i was using stochastic gradient descent for every single image (60k x 3 epochs = 180000 updates). i then tried using batching and used a batch of 100, the time to train reduced significantly but the model became extremely dumb and got a accuracy of 16.67%. reducing batchsize does improve the accuracy at the cost of more training time. i have seen people train this entrie data set with more epochs than me in under half a minute but idk why i cant do it

PS: i have written every function in the architecture myself but optimized them using pytorch's tensor mutiplication instead of python loops. my main use of pytorch is to make tensors and autograd. all of the the tensor multiplications happen in my GPU and not my CPU

2 Upvotes

0 comments sorted by