I recently finished coding my own MLP neural network in Python. To make my code easier to read, I separated the MLP, into classes; the network class, the layers class and the neuron class, where the neuron class would do all the calculations such as the activation and calculating the error signal. Each neuron also contained an array of the weights.
To verify the results of my MLP, I tried the sklearn-MLPClassifier with the same dataset, and found that sklearn was actually much faster to train than with my code.
Would my code be faster if I rewrite it with matrices? Whats the right way to code a NN and how can I get my performance to be comaparable to that of sklearn ?