Creating a Deep Learning Neural Net Framework from scratch in Python

Angad Sandhu
3 min readJan 3, 2021

“ The future is ours to shape. I feel we are in a race that we need to win. It’s a race between the growing power of the technology and the growing wisdom we need to manage it. “

~Max Tegmark

Similar to frameworks like Tensorflow, Pytorch, Keras, Caffe which abstract a lot of maths involved in Deep Learning we will be writing our own framework, to better understand how the above mentioned frameworks function.

This is part of an entire series of articles that I have written. The primary reason I wanted to write this article is because I was trying to build my basics in the foundations of Machine Learning, Deep Learning and AI

I have already learnt a lot, but recently I wanted to get into the open source community and also start reading on research. But, to do both of the things mentioned above

NOTE : This is not for complete beginners per say, but instead for the people who are getting into the field and want to deep dive into the nitty-gritty of the algorithms and math that make up the modern AI architectures. For people who are just starting out I would suggest the following Article I wrote specifically for this reason :

PART 1 : UNDERSTANDING NEURAL NETWORKS USING AN EXAMPLE

Here we will go through a neural network step-by-step to understand how it works.

I will not go too deeply into the equations that has been done by a lot of people. Instead, we will take an example of a 3-layer Neural Network

This is the Article :

PART 2 : WRITING A DYNAMIC NEURAL NETWORK FRAMEWORK FROM SCRATCH IN PYTHON

Here we will create a python class that initialized values dynamically and automatically and the performs processes like Forward Propagation, Back Propagation, Feed Forward, Calculating Loss etc.

This is the Article :

PART 3 : TRAINING & PREDICTING VALUES FROM THE NEURAL NETWORK FRAMEWORK WE CREATED

Now that we have created our very own framework. We will now test it and fine tune it with train data (which we will also create on our own). Hence, we will see the problems with our network and how to increase our efficiency.

This is the Article :

--

--

Angad Sandhu

Data Science | AI Developer | Full Stack Developer. I Build Things.