Motivation
Updating weights in each layer is the core of tuning a Neural Network. Now consider a simple regression model. If I ask you what method we use to update the weights? You'll probably reply — the method of least squares. And that is the most common thing. But it is to be noted that, Least Squares may not always be the most optimal method of updating weights. In this blog, I'd want to tell you about a very powerful method to get the weights. And if you have studied Numerical Analysis, you probably know about this. It's nothing but the very popular Newton-Raphson Method.
Well in general, this is used to solve equations numerically which are not solvable analytically. If we simply have to define the method, it will be something as follows:
Consider the equation, $$$f(x)=0$$$. Then, we can solve for x starting from any initial guess $$$x^{(0)}$$$; and for the $$$i$$$-th iteration, the update of the solution $$$x$$$ is given by,
$$$x^{(i)} = x^{(i-1)} - \frac{f\left(x^{(i-1)}\right)}{f'\left(x^{(i-1)}\right)}\quad[i \gt 0]$$$
Now let's apply this for weights $$$(\theta \in \mathbb{R}^n)$$$ in a simple Linear Regression model. Warning: Heavy Mathematics coming up!



