SlideShare a Scribd company logo
Gradient Descent
Glossary
Cost Function
Define
An algorithm to find the parameters to minimize the Cost Function
, a constant representing the rate of step
Example
假設
Limit
只能得到區域最佳解,無法得到全域或絕對最佳解
變異太⼤,導致收斂緩慢
改善⽅式:Feature Scaling
太⼤,可能無限的震盪,⽽⼀直錯過最佳解
運⾏完 Gradient Descent 後 反⽽容易有上升的情況
太⼩,很緩慢地找到最佳解
如何決定何時收斂完成
當 在運⾏過⼀次 Gradient Descent 後所下降的成本⼩於千分之⼀就代表其已收斂
了。
建議從 0.001, 0.003, 0.01 ...,持續乘以 3 來試
Proof (參考1)
假設
=
=
J( , ) =θ0 θ1
1
2m
∑m
i=1 ( ( ) − )hθ x(i)
y(i) 2
:= − α J(θ)θj θj
∂
∂θj
α
(x) = + xhθ θ0 θ1
:= − α J( , )θj θj
∂
∂θj
θ0 θ1
:= − α ( ( ) − )θ0 θ0
1
m ∑
m
i=1 hθ x(i)
y(i)
:= − α ( ( ) − ) ⋅θ1 θ1
1
m ∑
m
i=1 hθ x(i)
y(i)
x(i)
x
α
J(θ)
J(θ)
(x) = + xhθ θ0 θ1
J( , ) =θ0 θ1
1
2m
∑m
i=1 ( ( ) − )hθ x(i)
y(i) 2
= 1
2m
∑m
i=1 ( + − )θ0 θ1 x(i)
y(i) 2
:= − α J( , ) = − α g( , )θj θj
∂
∂θj
θ0 θ1 θj
∂
∂θj
θ0 θ1
g( , ) =θ0 θ1
1
2m
∑m
i=1 (f( , )θ0 θ1 )(i) 2
f( , = + −θ0 θ1 )(i)
θ0 θ1 x(i)
y(i)
g( , )∂
∂θj
θ0 θ1
g(f( , )∂
∂θj
θ0 θ1 )(i)
g( , ) f( ,∂
∂θj
θ0 θ1
∂
∂θj
θ0 θ1 )(i)
With respect to
With respect to
θ0
g( , )∂
∂θ0
θ0 θ1
= ∂
∂θ0
1
2m
∑m
i=1 (f( , )θ0 θ1 )(i) 2
= 2 × 1
2m
∑m
i=1 (f( , )θ0 θ1 )(i) 2−1
= f( ,1
m ∑m
i=1 θ0 θ1 )(i)
f( ,∂
∂θ0
θ0 θ1 )(i)
= ( + [a number][a number − [a number )∂
∂θ0
θ0 ](i)
](i)
= ∂
∂θ0
θ0
= 1
g( , ) f( ,∂
∂θ0
θ0 θ1
∂
∂θ0
θ0 θ1 )(i)
= f( , f( ,1
m ∑m
i=1 θ0 θ1 )(i) ∂
∂θ0
θ0 θ1 )(i)
= ( + − ) × 11
m ∑
m
i=1 θ0 θ1 x(i)
y(i)
= ( + − )
1
m ∑m
i=1 θ0 θ1 x(i)
y(i)
θ1
g( , )∂
∂θ1
θ0 θ1
= ∂
∂θ1
1
2m
∑m
i=1 (f( , )θ0 θ1 )(i) 2
= 2 × 1
2m
∑m
i=1 (f( , )θ0 θ1 )(i) 2−1
= f( ,1
m ∑m
i=1 θ0 θ1 )(i)
f( ,∂
∂θ1
θ0 θ1 )(i)
= ([a number] + [a number, ] − [a number )∂
∂θ1
θ1 x(i)
](i)
= 0 + ( − 0d
dθ1
θ1 )1
x(i)
= 1 × θ(1−1=0)
1 x(i)
= 1 × 1 × x(i)
= x(i)
g( , ) f( ,∂
∂θ1
θ0 θ1
∂
∂θ1
θ0 θ1 )(i)
= f( , f( ,1
m ∑
m
i=1 θ0 θ1 )(i) ∂
∂θ1
θ0 θ1 )(i)
= ( + − ) ⋅1
m ∑m
i=1 θ0 θ1 x(i)
y(i)
x(i)
= ( + − )
1
m ∑
m
i=1 θ0 θ1 x(i)
y(i)
x(i)

More Related Content

What's hot

Sol89
Sol89Sol89
Learning object 1
Learning object 1Learning object 1
Learning object 1
Sharon Kay
 
Real life Application of maximum and minimum
Real life Application of maximum and minimumReal life Application of maximum and minimum
Real life Application of maximum and minimum
Niloy Biswas
 
The Application of Derivatives
The Application of DerivativesThe Application of Derivatives
The Application of Derivatives
divaprincess09
 
Ch17 14
Ch17 14Ch17 14
Ch17 14
schibu20
 
Limits And Derivative
Limits And DerivativeLimits And Derivative
Limits And Derivative
Ashams kurian
 
Limit presentation pptx
Limit presentation pptxLimit presentation pptx
Limit presentation pptx
hamzarajput28
 
Derivatives and their Applications
Derivatives and their ApplicationsDerivatives and their Applications
Derivatives and their Applications
usmancp2611
 
Chapter 1 ex-1.3
Chapter 1 ex-1.3Chapter 1 ex-1.3
Chapter 1 ex-1.3
emadMaths
 
11.3 Distance Midpoint Formulas
11.3 Distance Midpoint Formulas11.3 Distance Midpoint Formulas
11.3 Distance Midpoint Formulas
Jessca Lundin
 
The Chain Rule, Part 1
The Chain Rule, Part 1The Chain Rule, Part 1
The Chain Rule, Part 1
Pablo Antuna
 
Co-orinate Geometry
Co-orinate Geometry Co-orinate Geometry
Co-orinate Geometry
mohan pudasaini
 
4.5 continuous functions and differentiable functions
4.5 continuous functions and differentiable functions4.5 continuous functions and differentiable functions
4.5 continuous functions and differentiable functions
math265
 
Applications of Differentiation
Applications of DifferentiationApplications of Differentiation
Applications of Differentiation
Joey Valdriz
 
Ch21 24
Ch21 24Ch21 24
Ch21 24
schibu20
 
Limit of functions
Limit of functionsLimit of functions
Limit of functions
Juan Apolinario Reyes
 

What's hot (16)

Sol89
Sol89Sol89
Sol89
 
Learning object 1
Learning object 1Learning object 1
Learning object 1
 
Real life Application of maximum and minimum
Real life Application of maximum and minimumReal life Application of maximum and minimum
Real life Application of maximum and minimum
 
The Application of Derivatives
The Application of DerivativesThe Application of Derivatives
The Application of Derivatives
 
Ch17 14
Ch17 14Ch17 14
Ch17 14
 
Limits And Derivative
Limits And DerivativeLimits And Derivative
Limits And Derivative
 
Limit presentation pptx
Limit presentation pptxLimit presentation pptx
Limit presentation pptx
 
Derivatives and their Applications
Derivatives and their ApplicationsDerivatives and their Applications
Derivatives and their Applications
 
Chapter 1 ex-1.3
Chapter 1 ex-1.3Chapter 1 ex-1.3
Chapter 1 ex-1.3
 
11.3 Distance Midpoint Formulas
11.3 Distance Midpoint Formulas11.3 Distance Midpoint Formulas
11.3 Distance Midpoint Formulas
 
The Chain Rule, Part 1
The Chain Rule, Part 1The Chain Rule, Part 1
The Chain Rule, Part 1
 
Co-orinate Geometry
Co-orinate Geometry Co-orinate Geometry
Co-orinate Geometry
 
4.5 continuous functions and differentiable functions
4.5 continuous functions and differentiable functions4.5 continuous functions and differentiable functions
4.5 continuous functions and differentiable functions
 
Applications of Differentiation
Applications of DifferentiationApplications of Differentiation
Applications of Differentiation
 
Ch21 24
Ch21 24Ch21 24
Ch21 24
 
Limit of functions
Limit of functionsLimit of functions
Limit of functions
 

Similar to Gradient Descent

functions limits and continuity
functions limits and continuityfunctions limits and continuity
functions limits and continuity
Pume Ananda
 
Functions limits and continuity
Functions limits and continuityFunctions limits and continuity
Functions limits and continuity
sudersana viswanathan
 
Quantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averagesQuantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averages
VjekoslavKovac1
 
Murphy: Machine learning A probabilistic perspective: Ch.9
Murphy: Machine learning A probabilistic perspective: Ch.9Murphy: Machine learning A probabilistic perspective: Ch.9
Murphy: Machine learning A probabilistic perspective: Ch.9
Daisuke Yoneoka
 
Reinforcement Learning: Hidden Theory and New Super-Fast Algorithms
Reinforcement Learning: Hidden Theory and New Super-Fast AlgorithmsReinforcement Learning: Hidden Theory and New Super-Fast Algorithms
Reinforcement Learning: Hidden Theory and New Super-Fast Algorithms
Sean Meyn
 
Statistical Inference Using Stochastic Gradient Descent
Statistical Inference Using Stochastic Gradient DescentStatistical Inference Using Stochastic Gradient Descent
Statistical Inference Using Stochastic Gradient Descent
Center for Transportation Research - UT Austin
 
Statistical Inference Using Stochastic Gradient Descent
Statistical Inference Using Stochastic Gradient DescentStatistical Inference Using Stochastic Gradient Descent
Statistical Inference Using Stochastic Gradient Descent
Center for Transportation Research - UT Austin
 
Gamma function
Gamma functionGamma function
Gamma function
Solo Hermelin
 
1520 differentiation-l1
1520 differentiation-l11520 differentiation-l1
1520 differentiation-l1
Dr Fereidoun Dejahang
 
Bc4103338340
Bc4103338340Bc4103338340
Bc4103338340
IJERA Editor
 
Application of derivatives 2 maxima and minima
Application of derivatives 2  maxima and minimaApplication of derivatives 2  maxima and minima
Application of derivatives 2 maxima and minima
sudersana viswanathan
 
Real Time Code Generation for Nonlinear Model Predictive Control
Real Time Code Generation for Nonlinear Model Predictive ControlReal Time Code Generation for Nonlinear Model Predictive Control
Real Time Code Generation for Nonlinear Model Predictive Control
Behzad Samadi
 
Derivatives vinnie
Derivatives vinnieDerivatives vinnie
Derivatives vinnie
canalculus
 
Differential calculus
Differential calculusDifferential calculus
Differential calculus
Chit Laplana
 
lesson10-thechainrule034slides-091006133832-phpapp01.pptx
lesson10-thechainrule034slides-091006133832-phpapp01.pptxlesson10-thechainrule034slides-091006133832-phpapp01.pptx
lesson10-thechainrule034slides-091006133832-phpapp01.pptx
JohnReyManzano2
 
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter ThreeA Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter Three
Chung Hua Universit
 
HMM, MEMM, CRF メモ
HMM, MEMM, CRF メモHMM, MEMM, CRF メモ
HMM, MEMM, CRF メモ
Takeshi Arabiki
 
3. DERIVATIVE BY INCREMENT IN CALULUS 01
3. DERIVATIVE BY INCREMENT IN CALULUS 013. DERIVATIVE BY INCREMENT IN CALULUS 01
3. DERIVATIVE BY INCREMENT IN CALULUS 01
oliverosmarcial24
 
Levy processes in the energy markets
Levy processes in the energy marketsLevy processes in the energy markets
Levy processes in the energy markets
Otmane Senhadji El Rhazi
 
stochastic processes assignment help
stochastic processes assignment helpstochastic processes assignment help
stochastic processes assignment help
Statistics Homework Helper
 

Similar to Gradient Descent (20)

functions limits and continuity
functions limits and continuityfunctions limits and continuity
functions limits and continuity
 
Functions limits and continuity
Functions limits and continuityFunctions limits and continuity
Functions limits and continuity
 
Quantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averagesQuantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averages
 
Murphy: Machine learning A probabilistic perspective: Ch.9
Murphy: Machine learning A probabilistic perspective: Ch.9Murphy: Machine learning A probabilistic perspective: Ch.9
Murphy: Machine learning A probabilistic perspective: Ch.9
 
Reinforcement Learning: Hidden Theory and New Super-Fast Algorithms
Reinforcement Learning: Hidden Theory and New Super-Fast AlgorithmsReinforcement Learning: Hidden Theory and New Super-Fast Algorithms
Reinforcement Learning: Hidden Theory and New Super-Fast Algorithms
 
Statistical Inference Using Stochastic Gradient Descent
Statistical Inference Using Stochastic Gradient DescentStatistical Inference Using Stochastic Gradient Descent
Statistical Inference Using Stochastic Gradient Descent
 
Statistical Inference Using Stochastic Gradient Descent
Statistical Inference Using Stochastic Gradient DescentStatistical Inference Using Stochastic Gradient Descent
Statistical Inference Using Stochastic Gradient Descent
 
Gamma function
Gamma functionGamma function
Gamma function
 
1520 differentiation-l1
1520 differentiation-l11520 differentiation-l1
1520 differentiation-l1
 
Bc4103338340
Bc4103338340Bc4103338340
Bc4103338340
 
Application of derivatives 2 maxima and minima
Application of derivatives 2  maxima and minimaApplication of derivatives 2  maxima and minima
Application of derivatives 2 maxima and minima
 
Real Time Code Generation for Nonlinear Model Predictive Control
Real Time Code Generation for Nonlinear Model Predictive ControlReal Time Code Generation for Nonlinear Model Predictive Control
Real Time Code Generation for Nonlinear Model Predictive Control
 
Derivatives vinnie
Derivatives vinnieDerivatives vinnie
Derivatives vinnie
 
Differential calculus
Differential calculusDifferential calculus
Differential calculus
 
lesson10-thechainrule034slides-091006133832-phpapp01.pptx
lesson10-thechainrule034slides-091006133832-phpapp01.pptxlesson10-thechainrule034slides-091006133832-phpapp01.pptx
lesson10-thechainrule034slides-091006133832-phpapp01.pptx
 
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter ThreeA Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter Three
 
HMM, MEMM, CRF メモ
HMM, MEMM, CRF メモHMM, MEMM, CRF メモ
HMM, MEMM, CRF メモ
 
3. DERIVATIVE BY INCREMENT IN CALULUS 01
3. DERIVATIVE BY INCREMENT IN CALULUS 013. DERIVATIVE BY INCREMENT IN CALULUS 01
3. DERIVATIVE BY INCREMENT IN CALULUS 01
 
Levy processes in the energy markets
Levy processes in the energy marketsLevy processes in the energy markets
Levy processes in the energy markets
 
stochastic processes assignment help
stochastic processes assignment helpstochastic processes assignment help
stochastic processes assignment help
 

Recently uploaded

Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 

Recently uploaded (20)

Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 

Gradient Descent

  • 1. Gradient Descent Glossary Cost Function Define An algorithm to find the parameters to minimize the Cost Function , a constant representing the rate of step Example 假設 Limit 只能得到區域最佳解,無法得到全域或絕對最佳解 變異太⼤,導致收斂緩慢 改善⽅式:Feature Scaling 太⼤,可能無限的震盪,⽽⼀直錯過最佳解 運⾏完 Gradient Descent 後 反⽽容易有上升的情況 太⼩,很緩慢地找到最佳解 如何決定何時收斂完成 當 在運⾏過⼀次 Gradient Descent 後所下降的成本⼩於千分之⼀就代表其已收斂 了。 建議從 0.001, 0.003, 0.01 ...,持續乘以 3 來試 Proof (參考1) 假設 = = J( , ) =θ0 θ1 1 2m ∑m i=1 ( ( ) − )hθ x(i) y(i) 2 := − α J(θ)θj θj ∂ ∂θj α (x) = + xhθ θ0 θ1 := − α J( , )θj θj ∂ ∂θj θ0 θ1 := − α ( ( ) − )θ0 θ0 1 m ∑ m i=1 hθ x(i) y(i) := − α ( ( ) − ) ⋅θ1 θ1 1 m ∑ m i=1 hθ x(i) y(i) x(i) x α J(θ) J(θ) (x) = + xhθ θ0 θ1 J( , ) =θ0 θ1 1 2m ∑m i=1 ( ( ) − )hθ x(i) y(i) 2 = 1 2m ∑m i=1 ( + − )θ0 θ1 x(i) y(i) 2 := − α J( , ) = − α g( , )θj θj ∂ ∂θj θ0 θ1 θj ∂ ∂θj θ0 θ1 g( , ) =θ0 θ1 1 2m ∑m i=1 (f( , )θ0 θ1 )(i) 2 f( , = + −θ0 θ1 )(i) θ0 θ1 x(i) y(i) g( , )∂ ∂θj θ0 θ1 g(f( , )∂ ∂θj θ0 θ1 )(i) g( , ) f( ,∂ ∂θj θ0 θ1 ∂ ∂θj θ0 θ1 )(i)
  • 2. With respect to With respect to θ0 g( , )∂ ∂θ0 θ0 θ1 = ∂ ∂θ0 1 2m ∑m i=1 (f( , )θ0 θ1 )(i) 2 = 2 × 1 2m ∑m i=1 (f( , )θ0 θ1 )(i) 2−1 = f( ,1 m ∑m i=1 θ0 θ1 )(i) f( ,∂ ∂θ0 θ0 θ1 )(i) = ( + [a number][a number − [a number )∂ ∂θ0 θ0 ](i) ](i) = ∂ ∂θ0 θ0 = 1 g( , ) f( ,∂ ∂θ0 θ0 θ1 ∂ ∂θ0 θ0 θ1 )(i) = f( , f( ,1 m ∑m i=1 θ0 θ1 )(i) ∂ ∂θ0 θ0 θ1 )(i) = ( + − ) × 11 m ∑ m i=1 θ0 θ1 x(i) y(i) = ( + − ) 1 m ∑m i=1 θ0 θ1 x(i) y(i) θ1 g( , )∂ ∂θ1 θ0 θ1 = ∂ ∂θ1 1 2m ∑m i=1 (f( , )θ0 θ1 )(i) 2 = 2 × 1 2m ∑m i=1 (f( , )θ0 θ1 )(i) 2−1 = f( ,1 m ∑m i=1 θ0 θ1 )(i) f( ,∂ ∂θ1 θ0 θ1 )(i) = ([a number] + [a number, ] − [a number )∂ ∂θ1 θ1 x(i) ](i) = 0 + ( − 0d dθ1 θ1 )1 x(i) = 1 × θ(1−1=0) 1 x(i) = 1 × 1 × x(i) = x(i) g( , ) f( ,∂ ∂θ1 θ0 θ1 ∂ ∂θ1 θ0 θ1 )(i) = f( , f( ,1 m ∑ m i=1 θ0 θ1 )(i) ∂ ∂θ1 θ0 θ1 )(i) = ( + − ) ⋅1 m ∑m i=1 θ0 θ1 x(i) y(i) x(i) = ( + − ) 1 m ∑ m i=1 θ0 θ1 x(i) y(i) x(i)