DL Notes Personal1
Types of Neural Networks
Perceptron :
x1, x2 = input
w1, w2 = weights
b = bias
z = sum of all these
now, z will be given to activation function
For example, step function, output will be 0 or 1
How to use it?
You train the model and find the value of w1, w2 and b
Perceptron is a line :
It's a binary classifier, that divides data into 2 regions
No, matter how many features we have, it will always divide the data into 2 parts
Limitation : Perceptron will be used on linear data onlyCode :
Prediction using perceptron
How do we find the correct values for weights?
Step 2 : randomly take one data point, if the point is on correct region, do nothing, else, move the line
Step 3 : repeat step 2 for 1000(n) times
How do we know that point is on correct region?
- we know that blue points should be in -ve region and green points should be in +ve regions
- so, we just have to make line transformations accordingly
How do we move towards correct values of A,B,C?
1. If you make change in C, line moves parallely
2. If you change x, line will move on the x axis, y is still same
3. same for change in y
Example :
If you want to move point in -ve region, you subtract it from line
If you want to move point in +ve region, you add it in line
but , in this way line will move very drastically, so we use learning rate.
Instead of using these 2 if conditions, it can be simplified to this 1 formula
Explanation :
3rd row = green point
4th row = red point
Perceptron loss function
mae
(Mean Absolute Error)
bce
(Binary Cross-Entropy)CCE
(Categorical Cross-Entropy)
SCE
(Sparse Categorical Cross-Entropy)
Task Type | Loss Function | Output Activation Function |
---|---|---|
Regression | MSE / MAE | Linear (None) |
Binary Class. | BCE | Sigmoid |
Multi-class | CCE / SCE | Softmax |
Backpropagation
Notice that, inside each iteration, step c will be performed 9 times as we have 9 weights
Comments
Post a Comment