- What’s is Gradient descent ? In order to find the min value of the LOSS Function, we need to fins the optimized parameter (w and b …). So Gradient descent is the one of the method to find it
- Example F(x) = X*X
- So let’s start with random point (let’s say… x = 5)
- Then we check the slope at this position F’(X) : if the slope > 0, then we move left, if the slope <0 then we move right ? Why ? because we need to move close to the min. point.
- learning rate: how far you want to move from step1 to step 2 etc..
2. We set the start point at X=5.1 (in theorem, this function has only one min. point, so no-matter which point you choose, you will get the final training result near Zero !
3. loop 1000 times. Which means we training 1000 times.
4. The f’(x) =df(x)/dx = 2 * x , we use it to calculate each slope as X moving …
5. Finally we get the result X. ~0, Bon!!
Note: The python is script language. So Golang is definitely faster than Python. When facing the biggest CNN structure or mul-ti dimension of Gradient Descent. You will see .. in later post …