“ 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…


If you are an aspiring engineering student, researcher or anyone who is closely interested in the field of AI, and you want to learn how to get started then this is the article for you.

NOTE : I AM CONSIDERING THAT ALL OF YOU ALREADY KNOW PYTHON PROGRAMMING LANGUAGE TO FULLY GRASP THE CONCEPTS OF AI, YOU CAN USE THE BELOW GIVEN RESOURCE AS A CRASH COURSE INTO PYTHON.

The New Paradigm

the basic textbook definition of AI goes like this :

Artificial Intelligence (AI) is widely known as a scientific field which aim is to make a computer, a robot…


Now, we will finally test our very simple framework, I have made 2 example files, that can be imported and used in our main.py(which will be the main execution file for our package).

I want you to understand and learn the code on your own. Hence, I am sharing this open source repository, so that all of you can clone it and tinker with it.

NOTE : IF YOU FIND ANY PROBLEMS WITH THE CODE OR WANT TO CONTRIBUTE, PLEASE CREATE AN ISSUE AND FORK THE REPOSITORY.

If you have not gone through the part 1 & part 2…


Now, we will start implementing our Neural Network Framework, by jumping right into python code!!!

If you have not read the Part 1 of this series, I would suggest you to please have a look, here :

Creating our Class Constructor

we will initialize our code,

  • taking input matrix
  • saving learning rate
  • number of layers of our Neural Network (default=2)
  • taking our output matrix
  • initializing our loss
Photo by Filiberto Santillán on Unsplash

Here, I have decided to randomly choose the number of nodes in all the hidden layer (excluding input and output layer) using randint(), where the minimum and maximum possible number of nodes are 2 and 10…


Information after looking at Neural Networks

I am TIRED!!! No really, hear me out.

I have read/seen articles, videos, books and blog posts about the mathematical functioning of Neural Networks, Algebra, Matrix multiplication and on and on…..

but none of the above mentioned resources give me the clear understanding that I want. So, now I am going to try to give you the full big picture. The code comes later, first we will focus on mastering the basics of a Neural Network and hence build our foundations to master Deep Learning Itself.

“ How will we do this? ” you…

Angad Sandhu

Data Science Enthusiast | Junior AI Developer | Beginner Full Stack Developer | Follow Me for more Articles…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store