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

Node and Auth0 - Integration

 so now we have completed all the steps for integration  since we have the node and auth0 as two separate things the integration happens in the app.js  we need to modify the app.js with some auth0 code  app.js / const http = require('http'); const express = require('express'); var router = require('express').Router(); const { auth } = require('express-openid-connect'); const app = express(); app.use('/', router); const hostname = '127.0.0.1'; const port = 3000; http.createServer(app)   .listen(port, () => {     console.log(`Listening on `);   }); const config = {   authRequired: false,   auth0Logout: true,   secret: 'a long, randomly-generated string stored in env',   baseURL: 'http://localhost:3000',   clientID: 'QxpAXsXkzy0Vm2VdT6dFFS0VOKdrah67',   issuerBaseURL: 'https://dev-bnga041p.us.auth0.com' }; console.log(config) // auth router attaches /login, /logout, and /callback routes to the baseURL app.u

Auth0

You might be wondering what is this auth0  it is used for authentication of you applications  could be any apps  1.SPA - Angular , React  2.web app 3.Node  here we will talk about the node use case and go with example  moving ahead for now  if your are not familiar with node dont worry its a funny exercise for now walk with me  we dont have to worry too much for authentication as the service is  provided from auth0   create your node app  install node  https://nodejs.org/en/download/package-manager/  choose your os and do the installation once installed check for the version ' node -v  ' i assume u have installed so that u wil get the version for now  since iam using LINUX this will look like root@strings-desktop:/home/strings/js# node -v v16.13.0 moving on to creating node app for now    create a file app.js and paste the contents  app.js/ const http = require('http'); const express = require('express'); const app = express(); const hostname = '127.0.0.1&#