Skip to main content

Partial Derivative - Introduction

 So what is partial derivatives ,don't worry i am not going to take a boring maths

class will go straight to the point

1.partial derivative are used in machine learning back propagation.

so all of a sudden what is this back propagation 

before that there must be a forward prop or forward pass ,

ok got it don't worry we will talk about a example


1.consider data points x =[1, 2, 3] some values for our understanding

2. consider a function y =x so the values of y will be [1, 2 , 3]

3.consider a function y= x^2 so the values of y will be [1, 4, 9]


 4. In real life the data points could be different and the dependent function y

could be like y =m*x +b or y = w1* x1 +w2  * x2 +b


as u can see the data plotted and the line we are trying to fit could be either the green or blue line ,

so what are tryin to achieve with this 

1. plot your data as X

2. have a function Y as dependant of X

3.use of function is to predict values of y for x


since we have introduced variables like m , b , w1, w2 which are part of the function .let take y =m*x +b

lets consider y_hat as the predicted value for any x

if y_hat is same as y the function is perfect so 

there is no loss = y - y_hat = 0

if loss > 0


1 . we cannot change the values of x ,the only way is to introduce a param 'm'

that can induce change .this is achieved by finding the near value of 'm' so that loss tends to zero.

2. start with  a random value of m and find the loss

3.update the value of 'm' so the loss tends to zero ?how to update the value

here comes the use of partial derivative (smallest change of 'm')


I think too much of story told 

consider a function y = x^2

partial derivative dy/dx  = 2*x      p.d- [x^n = n*x^n-1]


consider y = mx +b

p.d 

dy/dx = x

dy/db = 1

 

consider 

y  = w1*x1 +w2*x2 + b

p.d

dy/dw1 = x1

dy/dw2 = x2

dy/db = 1



Comments

Popular posts from this blog

SHA-256 initial values

The simple workout to arrive at the initial values for sha-256 The first 32 bit of the fractional part of the sqroot (first 8 prime number 2-19) Alright what does it say  Sqrroot(prime)- Let’s say the first prime is 2 Sqroot(2)  = 1.414213562373095 Convert to hexadecimal- Since we are worried about the fractional part alone Converting the fractional part would be easy Fractional part- 0.414213562373095 Multiply the fractional part with 16 to arrive at hex 0.414213562373095*16= 6.62741699796952 0.62741699796952*16= 10.03867196751232 0.03867196751232*16=0.61875148019712 0.61875148019712*16=9.90002368315392 0.90002368315392*16=14.40037893046272 0.40037893046272*16=6.40606288740352 0.40606288740352*16=6.49700619845632 0.49700619845632*16=7.95209917530112 Resulting hexadecimal would be 6a09e667 which is  h0 := 0x6a09e667 Iam going to stop at the 8th iteration , why is that ? Since we are interested in 32 bit (8*4=32) Alright to make it clear  Convert hexade...

Linear Regression with one variable - Introduction

 It is not but making a some how clear relationship among variables the dependent and independent variables. talking in terms of maths the equation can be used meaningfully for something may be to determine /predict values from data. if y = m * x + b  the values for m , b can be anything but has to appropriate to predict y  so the loss which is  difference from existing to prediction is close to zero ~0 to start with we can say the one variable as -x  in some scenario m , b are called variables    the equation stated about is a line equation we have any equation  y = 2*x  y = x*x y = 2x +2x*x  so why the need of all these equations , it is all about playing data now a days in machine learning problems we create a data sets , lets consider as x  y to be a value of x the datas . y = datas  when we express the data as a function and plot in the graph we get the curves  take some random data x and plot x and y  x =1 , 2, ...