I already know how to make a neural network using the mnist dataset. I have been searching for tutorials on how to train a neural network on your own dataset for 3 months now but I'm just not getting it. If someone can suggest any good tutorials or explain how all of this works, please help. PS. I won't install NLTK. It seems like a lot of people are training their neural network on text but I won't do that. If I would install NLTK, I would only use it once.
1 Answer
I suggest you use OpenCV library. Whatever you uses your MNIST data or PIL, when it's loaded, they're all just NumPy arrays. If you want to make MNIST datasets fit with your trained model, here's how I did it:
1.Use cv2.imread to load all the images you want them to act as training datasets.
2.Use cv2.cvtColor to convert all the images into grayscale images and resize them into 28x28.
3.Divide each pixel in all the datasets by 255.
4.Do the training as usual!
I haven't tried to make it your own format, but theoratically it's the same.
3 Comments
Kay Jersch
I didnt mean to load an image into my NN. Let's suppose I have input matrix of binary numbers and an output matrix of the next binary numbers. How do I make a network that trains on these matrices? (Sorry for my bad english. I hope that was understandable.)
Cro
I'm confused. Neural network is just a set of values that firstly gets your input , than optimize the random values for your expected output. So you just label it right or wrong, you have the labels and the input, what exactly do you mean "How do I make a network that trains on these matrices"?
Cro
Datasets don't need to be images , as to I say, you have the script, input and label, you have the output. I tried a simple dataset generated by np.random_normal, and it worked fine, and the accuracy is amazing.