# Perceptron

{% hint style="warning" %}
**Never converges on non-linearly separable data**
{% endhint %}

* It's the foundation of MLP and Deep Learning
* Each input value has a related weight and a bias value is added:

$$
z^{[i]} := b + \sum_{j=1}^n x_j^{[i]} * w_j \rightarrow 1\ if\ z^{[i]} > 0; 0\ otherwise
$$

<figure><img src="https://569842953-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmjpNbCRLUyGiAxD8kn%2Fuploads%2FDaUYDKgSCpHESH24U6Ut%2Fimage.png?alt=media&#x26;token=b1757a2d-b696-4352-a84e-72b35a5fe3a4" alt="" width="505"><figcaption></figcaption></figure>

* To update the weights iteratively, we compute the errors on each iteration:

$$
error := y^{[i]} - ŷ^{[i]} \\
w_j := w_j + error * x_j^{[i]}
$$

* Only capable of classifying using a linear boundary

<figure><img src="https://569842953-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmjpNbCRLUyGiAxD8kn%2Fuploads%2F3CVec9DNlVbuFOrIsnwE%2Fimage.png?alt=media&#x26;token=8627eada-3376-4dd3-bb9f-7b8c9a8fb0d6" alt=""><figcaption></figcaption></figure>



