## GRADIENT DESCENT OPTIMIZATION

Let’s see how to create gradient descent algorithm in tensorflow. So, now go with formulation.

As what you have already to compute is -: And computation is build on following case-: – As you need to get the cost function and that cost function pass without the gradients and update the values.

– Compute the gradient,

– First consider the initial value as-:

a = a_i + \nabla (sse) | a * LR

And with this formula representation is as-: And similarly for ‘b’. – Now let’s create a train function and also converts outputs into tensor. – Now apply the gradient descent. As tensorflow has special function i.e. gradient tape. Gradient tape will calculate gradients at any particular values of a and b or any particular values of weights.

– Let’s initialize gradient tape and after calculate the current loss for any particular iteration for specify the true values as-: Let’s calculate now in change in values of a and b with respect to g, for which find the gradient with respect to current loss including model parameters. Finally you need to update the values. So this is what the gradient descent algorithm and also training loop iteration, you need to follow in tensorflow. Apply now for Advanced Python Training Course