Cost/Loss function

Let’s say we started a mobile manufacturing company last month and I want a new cost study to improve my next month’s budget forecasts.I pay 500$ for rent and 100$ for electricity bill and for manufacturing each mobile we need 50$ and my budget is 4500$

        The equation of cost function is C(x)= FC + V(x)

Now let’s say I want to manufacture 100 mobiles, what is my cost? Lets derive our equation for cost function.

                C(x) = 100

                FC = (500+100) * 1 months  =  600

                V(x) = manufacturing cost per mobile (50) = 100*50 = 5000

                C(x) = 600 + 5000 = 5600

                  So from above equation to manufacture 100 mobiles in a month I need to pay 5600$, but my budget is 4500$ per month

                  Now I need to think how to minimize this cost function per month.

In math world the cost function  is how close the predicted values are to their corresponding real values.We can calculate using Mean Squared Error

In one of our article How to calculate linear regression, we predicted the sugar levels(Y) based on age(X), did we got correct value there? No, we didn’t, How close is my predicted variable to the actual value we can say cost function. PFB screenshot from our article how to calculate accuracy.

Gradient:

What is Gradient then? In general the degree of inclination, or the rate of ascent or descent, in a highway, railroad, etc. from http://www.dictionary.com

Hope now you can correlate cost function and Gradient.

Cost function says how close is my predicted value to the real value and Gradient will help you to reduce the gap/error between the actual value and predicted value which means to reduce the cost function/error in order to get the accurate score.

Let’s make it more simple, we need to reduce the Cost function here for best accuracy and Gradient will help us to reduce it.

In this article we will discuss more on Gradient Descent,we have seen the meaning of Gradient above it says either increase/ascent or decrease/descent, in our case we need to decrease the error(Cost function), So we are calling it as Gradient Descent.

Learning Rate:

In general how quickly I am learning a new concepts, I should not learn too slow or too fast that can mislead the things, we should learn in moderate. Please see the blow image.

Same in case of Machine Learning, We know Gradient descent is used to reduce the error(to find optimization value),how fast I can find the best value will be said by learning rate.

We will denote learning rate with alfa

Source https://www.jeremyjordan.me/nn-learning-rate/

Published by viswateja3

Hi

Leave a comment