NumPy vs. Python

A comparison between the time of execution of NumPy and pure Python code.

As you can learn in Make Your Own Neural Network we worked out the calculations that needed to be done for passing the signal forward through a neural network, and also for the backward pass that updates the network link weights.

We found that both of these calculations could be written using matrix multiplication. Instead of writing out hundreds, or even thousands, of separate calculations, we could just write down a simple matrix multiplication. We were excited by this because libraries like NumPy are designed to do matrix multiplication really quickly and efficiently. Using NumPy to multiply two matrices is far more efficient than writing Python code to work through all the different combinations of calculations required.

Get hands-on with 1200+ tech skills courses.