Neural Network from Scratch in Python π
Learn to build a multi-class classifier with Softmax in Python by creating a neural network from scratch.

Learn With Jay
35.2K views β’ May 29, 2021

About this video
Implement Neural Network in Python from Scratch ! In this video, we will implement MultClass Classification with Softmax by making a Neural Network in Python from Scratch. We will not use any build in models, but we will understand the Mathematics and Code behind the Neural Network in Python.
ββββIMPORTANT NOTEββββ
I made a small mistake while typing the code for derivative_tanh(x) function.
β The correct code will be :
def derivative_tanh(x):
return 1 - np.power(np.tanh(x), 2)
β And not:
def derivative_tanh(x):
return 1 - np.power(x, 2)
I have explained it in this video at 19:05 : https://www.youtube.com/watch?v=URJ9pP1aURo&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD&index=5
βββββββββββββββ
π Download the ASSIGNMENT and Implementation Code : https://github.com/Coding-Lane/Neural-Network---MultiClass-Classifcation-with-Softmax
βββββββββββββββ
β Complete Neural Network Playlist : https://www.youtube.com/watch?v=mlk0rddP3L4&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD
βββββββββββββββ
π LEARNINGS : Why did Cost increased at the beginning of training the model?
β Answer : It is because our weights W were very large. We multiplied 0.01 with them, but still it was not enough.
β Solution : Multiply 0.001 with weights W, instead of 0.01. You will that problem will be solved and you will have a steady decreasing cost function.
There are many weight initialization techniques in Deep Learning to solve such problems and more. We will discuss them in the upcoming videos. We will see why is it necessary to initialize weights randomly and not with zeros. And also why weights need to be small !
βββββββββββββββ
β How Neural Network works ? : https://www.youtube.com/watch?v=mlk0rddP3L4&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD&index=1
β Forward and Backpropagation in Neural Network : https://www.youtube.com/watch?v=Tb23YtZ92AE&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD&index=2
β Activation Functions in Neural Network : https://www.youtube.com/watch?v=Y9qdKsOHRjA&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD&index=3
β Types of Cost Functions in Neural Network : https://www.youtube.com/watch?v=NJpABYQB9PI&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD&index=4
β Derivation of Equations in Backpropagation : https://www.youtube.com/watch?v=URJ9pP1aURo&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD&index=5
β Backpropagation in MultiClass Classification with Softmax : https://www.youtube.com/watch?v=f-nW8cSa_Ec&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD&index=6
βββββββββββββββ
0:00 Intro and Agenda
1:41 Importing Dataset
5:18 Neural Network summary
7:10 Activation Function
8:55 Initializing Parameters
10:20 Forward Propagation Implementation
11:48 Cost Function Implementation
12:58 Backpropagation Implementation
15:40 Update Parameters Implementation
16:28 Complete Model Implementation
22:01 Checking Accuracy
25:02 Making Predictions
25:32 Ending
βββββββββββββββ
Learn what is Supervised Learning : https://www.youtube.com/watch?v=Bo5dJT1QlHc&list=PLuhqtP7jdD8BpW2kOdIbjLI3HpuqeoMb-&index=2
Complete Neural Network playlist : https://www.youtube.com/watch?v=U1omz0B9FTw&list=PLuhqtP7jdD8Chy7QIo5U0zzKP8-emLdny
Complete Logistic Regression Playlist : https://www.youtube.com/watch?v=xJjr_LPfBCQ&list=PLuhqtP7jdD8BpW2kOdIbjLI3HpuqeoMb-
βββββββββββββββ
This is Your Lane to Machine Learning β
βββββββββββββββ
Subscribe to my channel, because I upload a new Machine Learning video every week : https://www.youtube.com/channel/UCJFAF6IsaMkzHBDdfriY-yQ?sub_confirmation=1
ββββIMPORTANT NOTEββββ
I made a small mistake while typing the code for derivative_tanh(x) function.
β The correct code will be :
def derivative_tanh(x):
return 1 - np.power(np.tanh(x), 2)
β And not:
def derivative_tanh(x):
return 1 - np.power(x, 2)
I have explained it in this video at 19:05 : https://www.youtube.com/watch?v=URJ9pP1aURo&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD&index=5
βββββββββββββββ
π Download the ASSIGNMENT and Implementation Code : https://github.com/Coding-Lane/Neural-Network---MultiClass-Classifcation-with-Softmax
βββββββββββββββ
β Complete Neural Network Playlist : https://www.youtube.com/watch?v=mlk0rddP3L4&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD
βββββββββββββββ
π LEARNINGS : Why did Cost increased at the beginning of training the model?
β Answer : It is because our weights W were very large. We multiplied 0.01 with them, but still it was not enough.
β Solution : Multiply 0.001 with weights W, instead of 0.01. You will that problem will be solved and you will have a steady decreasing cost function.
There are many weight initialization techniques in Deep Learning to solve such problems and more. We will discuss them in the upcoming videos. We will see why is it necessary to initialize weights randomly and not with zeros. And also why weights need to be small !
βββββββββββββββ
β How Neural Network works ? : https://www.youtube.com/watch?v=mlk0rddP3L4&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD&index=1
β Forward and Backpropagation in Neural Network : https://www.youtube.com/watch?v=Tb23YtZ92AE&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD&index=2
β Activation Functions in Neural Network : https://www.youtube.com/watch?v=Y9qdKsOHRjA&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD&index=3
β Types of Cost Functions in Neural Network : https://www.youtube.com/watch?v=NJpABYQB9PI&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD&index=4
β Derivation of Equations in Backpropagation : https://www.youtube.com/watch?v=URJ9pP1aURo&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD&index=5
β Backpropagation in MultiClass Classification with Softmax : https://www.youtube.com/watch?v=f-nW8cSa_Ec&list=PLuhqtP7jdD8CftMk831qdE8BlIteSaNzD&index=6
βββββββββββββββ
0:00 Intro and Agenda
1:41 Importing Dataset
5:18 Neural Network summary
7:10 Activation Function
8:55 Initializing Parameters
10:20 Forward Propagation Implementation
11:48 Cost Function Implementation
12:58 Backpropagation Implementation
15:40 Update Parameters Implementation
16:28 Complete Model Implementation
22:01 Checking Accuracy
25:02 Making Predictions
25:32 Ending
βββββββββββββββ
Learn what is Supervised Learning : https://www.youtube.com/watch?v=Bo5dJT1QlHc&list=PLuhqtP7jdD8BpW2kOdIbjLI3HpuqeoMb-&index=2
Complete Neural Network playlist : https://www.youtube.com/watch?v=U1omz0B9FTw&list=PLuhqtP7jdD8Chy7QIo5U0zzKP8-emLdny
Complete Logistic Regression Playlist : https://www.youtube.com/watch?v=xJjr_LPfBCQ&list=PLuhqtP7jdD8BpW2kOdIbjLI3HpuqeoMb-
βββββββββββββββ
This is Your Lane to Machine Learning β
βββββββββββββββ
Subscribe to my channel, because I upload a new Machine Learning video every week : https://www.youtube.com/channel/UCJFAF6IsaMkzHBDdfriY-yQ?sub_confirmation=1
Tags and Topics
Browse our collection to discover more content in these categories.
Video Information
Views
35.2K
Likes
740
Duration
26:14
Published
May 29, 2021
User Reviews
4.7
(7) Related Trending Topics
LIVE TRENDSRelated trending topics. Click any trend to explore more videos.
Trending Now