-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path807877e5.da1bcfc4.js
1 lines (1 loc) · 43.8 KB
/
807877e5.da1bcfc4.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{149:function(e,a,t){"use strict";t.r(a),a.default=t.p+"assets/files/b-07-sgd-090dfd9f872f2866b10a6b2e1997a9cd.pdf"},77:function(e,a,t){"use strict";t.r(a),t.d(a,"frontMatter",(function(){return m})),t.d(a,"metadata",(function(){return b})),t.d(a,"rightToc",(function(){return p})),t.d(a,"default",(function(){return i}));var s=t(2),n=t(6),c=(t(0),t(94)),m={title:"Stochastic Gradient Decent"},b={unversionedId:"sec-b/b-07-sgd",id:"sec-b/b-07-sgd",isDocsHomePage:!1,title:"Stochastic Gradient Decent",description:"Authors: Eliesha Lai, Shruti Kolhatkar, Chirag Ramesh. (PDF)",source:"@site/docs\\sec-b\\b-07-sgd.md",slug:"/sec-b/b-07-sgd",permalink:"/APM-2020/docs/sec-b/b-07-sgd",version:"current",lastUpdatedAt:1603328123,sidebar:"docs",previous:{title:"Beyond Linear Regression and Gradient Descent",permalink:"/APM-2020/docs/sec-b/b-06-gradient-descent"},next:{title:"Neural Networks",permalink:"/APM-2020/docs/sec-b/b-08-nn"}},p=[{value:"Introduction",id:"introduction",children:[]},{value:"What is Gradient descent?",id:"what-is-gradient-descent",children:[]},{value:"What Are Gradients?",id:"what-are-gradients",children:[]},{value:"Stochastic Gradient Descent",id:"stochastic-gradient-descent",children:[]},{value:"Resources",id:"resources",children:[]}],r={rightToc:p};function i(e){var a=e.components,m=Object(n.a)(e,["components"]);return Object(c.b)("wrapper",Object(s.a)({},r,m,{components:a,mdxType:"MDXLayout"}),Object(c.b)("p",null,"Authors: Eliesha Lai, Shruti Kolhatkar, Chirag Ramesh. (",Object(c.b)("a",{target:"_blank",href:t(149).default},"PDF"),")"),Object(c.b)("h2",{id:"introduction"},"Introduction"),Object(c.b)("p",null,"The lecture covered Stochastic Gradient Decent, also it gave brief about the cost function and Gradient Decent. SGD mostly talks about handling the data little bit at same time and deal with it as it comes that is with respect to the time, while explaining this, professor also gave example about the stock market, where we have to constantly adapt with the new data. If we are handling whole data simultaneously the process becomes slow and time consuming, so SGD allows us to work faster and it reacts faster to input and output changes.",Object(c.b)("br",{parentName:"p"}),"\n","##Cost Function"),Object(c.b)("p",null,"A cost finction, also called loss function is used to measure how well a neural networks predicts the outputs on the test set. One common way we used is mean squared error, in which we measure the differences between the actual value of y and the predicted value of y. It's fair to say that our goal of models is to minimize the cost function."),Object(c.b)("p",null,Object(c.b)("img",Object(s.a)({parentName:"p"},{src:"https://i.imgur.com/Mh0nzIO.jpg",alt:"Imgur"}))),Object(c.b)("p",null,"J(",Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("msub",{parentName:"mrow"},Object(c.b)("mi",{parentName:"msub"},"\u03b8"),Object(c.b)("mn",{parentName:"msub"},"0"))),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"\\theta_0")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"0.84444em",verticalAlign:"-0.15em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal",style:{marginRight:"0.02778em"}}),"\u03b8"),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"msupsub"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-t vlist-t2"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.30110799999999993em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{style:{top:"-2.5500000000000003em",marginLeft:"-0.02778em",marginRight:"0.05em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"pstrut",style:{height:"2.7em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"sizing reset-size6 size3 mtight"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mtight"}),"0")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-s"}),"\u200b")),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.15em"}}),Object(c.b)("span",{parentName:"span"})))))))))),",",Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("msub",{parentName:"mrow"},Object(c.b)("mi",{parentName:"msub"},"\u03b8"),Object(c.b)("mn",{parentName:"msub"},"1"))),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"\\theta_1")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"0.84444em",verticalAlign:"-0.15em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal",style:{marginRight:"0.02778em"}}),"\u03b8"),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"msupsub"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-t vlist-t2"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.30110799999999993em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{style:{top:"-2.5500000000000003em",marginLeft:"-0.02778em",marginRight:"0.05em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"pstrut",style:{height:"2.7em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"sizing reset-size6 size3 mtight"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mtight"}),"1")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-s"}),"\u200b")),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.15em"}}),Object(c.b)("span",{parentName:"span"})))))))))),") is the cost finction we try to minimize."),Object(c.b)("p",null,"So we use the function J(",Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("msub",{parentName:"mrow"},Object(c.b)("mi",{parentName:"msub"},"\u03b8"),Object(c.b)("mn",{parentName:"msub"},"0"))),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"\\theta_0")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"0.84444em",verticalAlign:"-0.15em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal",style:{marginRight:"0.02778em"}}),"\u03b8"),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"msupsub"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-t vlist-t2"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.30110799999999993em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{style:{top:"-2.5500000000000003em",marginLeft:"-0.02778em",marginRight:"0.05em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"pstrut",style:{height:"2.7em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"sizing reset-size6 size3 mtight"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mtight"}),"0")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-s"}),"\u200b")),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.15em"}}),Object(c.b)("span",{parentName:"span"})))))))))),",",Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("msub",{parentName:"mrow"},Object(c.b)("mi",{parentName:"msub"},"\u03b8"),Object(c.b)("mn",{parentName:"msub"},"1"))),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"\\theta_1")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"0.84444em",verticalAlign:"-0.15em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal",style:{marginRight:"0.02778em"}}),"\u03b8"),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"msupsub"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-t vlist-t2"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.30110799999999993em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{style:{top:"-2.5500000000000003em",marginLeft:"-0.02778em",marginRight:"0.05em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"pstrut",style:{height:"2.7em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"sizing reset-size6 size3 mtight"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mtight"}),"1")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-s"}),"\u200b")),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.15em"}}),Object(c.b)("span",{parentName:"span"})))))))))),") to minimize the total difference between all predictions and reality by inputting different ",Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("msub",{parentName:"mrow"},Object(c.b)("mi",{parentName:"msub"},"\u03b8"),Object(c.b)("mn",{parentName:"msub"},"0"))),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"\\theta_0")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"0.84444em",verticalAlign:"-0.15em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal",style:{marginRight:"0.02778em"}}),"\u03b8"),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"msupsub"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-t vlist-t2"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.30110799999999993em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{style:{top:"-2.5500000000000003em",marginLeft:"-0.02778em",marginRight:"0.05em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"pstrut",style:{height:"2.7em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"sizing reset-size6 size3 mtight"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mtight"}),"0")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-s"}),"\u200b")),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.15em"}}),Object(c.b)("span",{parentName:"span"}))))))))))," and ",Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("msub",{parentName:"mrow"},Object(c.b)("mi",{parentName:"msub"},"\u03b8"),Object(c.b)("mn",{parentName:"msub"},"1"))),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"\\theta_1")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"0.84444em",verticalAlign:"-0.15em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal",style:{marginRight:"0.02778em"}}),"\u03b8"),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"msupsub"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-t vlist-t2"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.30110799999999993em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{style:{top:"-2.5500000000000003em",marginLeft:"-0.02778em",marginRight:"0.05em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"pstrut",style:{height:"2.7em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"sizing reset-size6 size3 mtight"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mtight"}),"1")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-s"}),"\u200b")),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.15em"}}),Object(c.b)("span",{parentName:"span"}))))))))))," to find the best ",Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("msub",{parentName:"mrow"},Object(c.b)("mi",{parentName:"msub"},"\u03b8"),Object(c.b)("mn",{parentName:"msub"},"0"))),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"\\theta_0")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"0.84444em",verticalAlign:"-0.15em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal",style:{marginRight:"0.02778em"}}),"\u03b8"),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"msupsub"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-t vlist-t2"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.30110799999999993em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{style:{top:"-2.5500000000000003em",marginLeft:"-0.02778em",marginRight:"0.05em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"pstrut",style:{height:"2.7em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"sizing reset-size6 size3 mtight"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mtight"}),"0")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-s"}),"\u200b")),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.15em"}}),Object(c.b)("span",{parentName:"span"}))))))))))," and ",Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("msub",{parentName:"mrow"},Object(c.b)("mi",{parentName:"msub"},"\u03b8"),Object(c.b)("mn",{parentName:"msub"},"1"))),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"\\theta_1")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"0.84444em",verticalAlign:"-0.15em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal",style:{marginRight:"0.02778em"}}),"\u03b8"),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"msupsub"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-t vlist-t2"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.30110799999999993em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{style:{top:"-2.5500000000000003em",marginLeft:"-0.02778em",marginRight:"0.05em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"pstrut",style:{height:"2.7em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"sizing reset-size6 size3 mtight"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mtight"}),"1")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-s"}),"\u200b")),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.15em"}}),Object(c.b)("span",{parentName:"span"})))))))))),"."),Object(c.b)("p",null,Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("msub",{parentName:"mrow"},Object(c.b)("mi",{parentName:"msub"},"h"),Object(c.b)("mi",{parentName:"msub"},"\u03b8")),Object(c.b)("mo",Object(s.a)({parentName:"mrow"},{stretchy:"false"}),"("),Object(c.b)("mi",{parentName:"mrow"},"x"),Object(c.b)("mo",Object(s.a)({parentName:"mrow"},{stretchy:"false"}),")")),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"h_\\theta(x)")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal"}),"h"),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"msupsub"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-t vlist-t2"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.33610799999999996em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{style:{top:"-2.5500000000000003em",marginLeft:"0em",marginRight:"0.05em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"pstrut",style:{height:"2.7em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"sizing reset-size6 size3 mtight"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal mtight",style:{marginRight:"0.02778em"}}),"\u03b8")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-s"}),"\u200b")),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.15em"}}),Object(c.b)("span",{parentName:"span"})))))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mopen"}),"("),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal"}),"x"),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mclose"}),")")))))," refers to the predicted value, when we input different values \u200b\u200bof x after a fixed ",Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("mi",{parentName:"mrow"},"\u03b8")),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"\\theta")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"0.69444em",verticalAlign:"0em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal",style:{marginRight:"0.02778em"}}),"\u03b8")))))," is given.\nTherefore, ",Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("msub",{parentName:"mrow"},Object(c.b)("mi",{parentName:"msub"},"h"),Object(c.b)("mi",{parentName:"msub"},"\u03b8")),Object(c.b)("mo",Object(s.a)({parentName:"mrow"},{stretchy:"false"}),"("),Object(c.b)("mi",{parentName:"mrow"},"x"),Object(c.b)("mo",Object(s.a)({parentName:"mrow"},{stretchy:"false"}),")")),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"h_\\theta(x)")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal"}),"h"),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"msupsub"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-t vlist-t2"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.33610799999999996em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{style:{top:"-2.5500000000000003em",marginLeft:"0em",marginRight:"0.05em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"pstrut",style:{height:"2.7em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"sizing reset-size6 size3 mtight"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal mtight",style:{marginRight:"0.02778em"}}),"\u03b8")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-s"}),"\u200b")),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.15em"}}),Object(c.b)("span",{parentName:"span"})))))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mopen"}),"("),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal"}),"x"),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mclose"}),")"))))),' is the "prediction", and the y value is the "reality".'),Object(c.b)("p",null,Object(c.b)("img",Object(s.a)({parentName:"p"},{src:"https://i.imgur.com/m0gnMi4.png",alt:"Imgur"}))),Object(c.b)("p",null,"The red X is the information we are given (reality), and the black line represents the corresponding values \u200b\u200bof x and y contained in our function ",Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("msub",{parentName:"mrow"},Object(c.b)("mi",{parentName:"msub"},"h"),Object(c.b)("mi",{parentName:"msub"},"\u03b8")),Object(c.b)("mo",Object(s.a)({parentName:"mrow"},{stretchy:"false"}),"("),Object(c.b)("mi",{parentName:"mrow"},"x"),Object(c.b)("mo",Object(s.a)({parentName:"mrow"},{stretchy:"false"}),")")),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"h_\\theta(x)")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal"}),"h"),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"msupsub"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-t vlist-t2"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.33610799999999996em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{style:{top:"-2.5500000000000003em",marginLeft:"0em",marginRight:"0.05em"}}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"pstrut",style:{height:"2.7em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"sizing reset-size6 size3 mtight"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal mtight",style:{marginRight:"0.02778em"}}),"\u03b8")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-s"}),"\u200b")),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist-r"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"vlist",style:{height:"0.15em"}}),Object(c.b)("span",{parentName:"span"})))))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mopen"}),"("),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal"}),"x"),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mclose"}),")"))))),".In order to make a more accurate prediction, we have to try to make the blue lines (the gap) close to our data set."),Object(c.b)("h1",{id:"gradient-descent"},"Gradient Descent"),Object(c.b)("h2",{id:"what-is-gradient-descent"},"What is Gradient descent?"),Object(c.b)("p",null,"Gradient descent is defined as a first-order optimization algorithm that is used for finding a local minimum of a differentiable function. The algorithm minimizes the function by iterating and moving in the direction of the steepest descent."),Object(c.b)("p",null,Object(c.b)("img",Object(s.a)({parentName:"p"},{src:"https://i.imgur.com/J9kBa8J.png",alt:"Imgur"}))),Object(c.b)("p",null,'In the example above we are basically using the gradient descent algorithm to find the value of "x" where "y" reaches its minimum point. Gradient descent is an iterative algorithm that starts from a random point and travels down the slope until it reaches the lowest point of that function.'),Object(c.b)("p",null,"The picture below gives us an accurate overview of gradient descent."),Object(c.b)("p",null,Object(c.b)("img",Object(s.a)({parentName:"p"},{src:"https://i.imgur.com/Olwy3OH.png?1",alt:"Imgur"}))),Object(c.b)("h2",{id:"what-are-gradients"},"What Are Gradients?"),Object(c.b)("p",null,"A gradient is just a way of quantifying the relationship in neural network, which can be graphed as a slope, between error and the weights. The steepness of the slope represents how fast the model is learning."),Object(c.b)("p",null,"A steeper slope means large reductions in error are being made and the model is learning fast, whereas if the slope is zero the model is on a plateau and isn't learning. We can move down the slope towards less error by calculating a gradient, a direction of movement (change in the parameters of the network) for our model."),Object(c.b)("p",null,"Let's imagine a series of hills and valleys. We want to get to the bottom of the hill (lowest loss). When we start at the top of the hill we can take large steps down the hill and be confident that we are heading towards the lowest point in the valley."),Object(c.b)("p",null,"However, as we get closer to the lowest point in the valley, our steps will need to become smaller, or else we could overshoot the true lowest point. Similarly, it's possible that when adjusting the weights of the network, the adjustments can actually take it further away from the point of lowest loss, and therefore the adjustments must get smaller over time. "),Object(c.b)("p",null,"Now we know that gradients are instructions that tell us which direction to move in (which coefficients should be updated) and how large the steps we should take are (how much the coefficients should be updated), we can explore how the gradient is calculated."),Object(c.b)("p",null,"##Calculating Gradients & Gradient Descent"),Object(c.b)("p",null,"Gradient descent starts at a place of high loss and by through multiple iterations, takes steps in the direction of lowest loss, aiming to find the optimal weight configuration. "),Object(c.b)("p",null,"In order to calculate the gradient, we need to know the loss/cost function. We'll use the cost function to determine the derivative.If we represent the loss function as \"f\", then we can state that the equation for calculating the loss is as follows (we're just running the coefficients through our chosen cost function):"),Object(c.b)("p",null,"Loss = f(coefficient)"),Object(c.b)("p",null,'We then calculate the derivative, or determine the slope. Getting the derivative of the loss will tell us which direction is up or down the slope, by giving us the appropriate sign to adjust our coefficients by. We\'ll represent the appropriate direction as "delta".'),Object(c.b)("p",null,"delta = derivative_function(loss)"),Object(c.b)("p",null,'We\'ve now determined which direction is downhill towards the point of lowest loss. This means we can update the coefficients in the neural network parameters and hopefully reduce the loss. How we update the coefficients is shown below. The argument that controls the size of the update is called the "learning rate".'),Object(c.b)("p",null,"coefficient = coefficient \u2013 (learning rate * delta)"),Object(c.b)("p",null,"We then just repeat this process until the network has converged around the point of lowest loss, which should be near zero."),Object(c.b)("p",null,"It's very important to choose the right value for the learning rate. The chosen learning rate must be neither too small or too large. If the step sizes are too large, the network's performance will continue to bounce. In contrast, if the learning rate is too small the network can potentially take an extraordinarily long time to converge on the optimal weights."),Object(c.b)("p",null,"The steps of the algorithm are"),Object(c.b)("ol",null,Object(c.b)("li",{parentName:"ol"},Object(c.b)("p",{parentName:"li"},"Find the slope of the objective function with respect to each parameter/feature. In other words, compute the gradient of the function.")),Object(c.b)("li",{parentName:"ol"},Object(c.b)("p",{parentName:"li"},'Pick a random initial value for the parameters. (To clarify, in the parabola example, differentiate "y" with respect to "x". If we had more features like x1, x2 etc., we take the partial derivative of "y" with respect to each of the features.)')),Object(c.b)("li",{parentName:"ol"},Object(c.b)("p",{parentName:"li"},"Update the gradient function by plugging in the parameter values.")),Object(c.b)("li",{parentName:"ol"},Object(c.b)("p",{parentName:"li"},"Calculate the step sizes for each feature as : step size = gradient * learning rate.")),Object(c.b)("li",{parentName:"ol"},Object(c.b)("p",{parentName:"li"},"Calculate the new parameters as : new params = old params -step size")),Object(c.b)("li",{parentName:"ol"},Object(c.b)("p",{parentName:"li"},"Repeat steps 3 to 5 until gradient is almost 0."))),Object(c.b)("h2",{id:"stochastic-gradient-descent"},"Stochastic Gradient Descent"),Object(c.b)("p",null,"Stochastic gradient descent is an iterative method for optimizing an objective function with suitable smoothness properties . It can be regarded as a stochastic approximation of gradient descent optimization, since it replaces the actual gradient (calculated from the entire data set) by an estimate thereof (calculated from a randomly selected subset of the data). Especially in high-dimensional optimization problems this reduces the computational burden, achieving faster iterations in trade for a lower convergence rate.Stochastic gradient descent is commonly used practical algorithms for large scale stochastic optimization. It is mainly used where we are getting data continuously, e.g. video streaming.Practically, computing the cost and gradient for the entire training set, can be very slow and sometimes intractable on a single machine if the dataset is too big to fit in main memory.Thus, SGD can be used if we have storage limitations."),Object(c.b)("p",null,"The standard gradient descent algorithm updates the parameters ",Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("mi",{parentName:"mrow"},"\u03b8")),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"\\theta")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"0.69444em",verticalAlign:"0em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal",style:{marginRight:"0.02778em"}}),"\u03b8")))))," of the objective J(",Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("mi",{parentName:"mrow"},"\u03b8")),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"\\theta")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"0.69444em",verticalAlign:"0em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal",style:{marginRight:"0.02778em"}}),"\u03b8"))))),") as,"),Object(c.b)("p",null,Object(c.b)("img",Object(s.a)({parentName:"p"},{src:"https://i.imgur.com/KQ86qSZ.png",alt:"Imgur"}))),Object(c.b)("p",null,"where the expectation in the above equation is approximated by evaluating the cost and gradient over the full training set. Stochastic Gradient Descent (SGD) simply does away with the expectation in the update and computes the gradient of the parameters using only a single or a few training examples. The new update is given by,"),Object(c.b)("p",null,Object(c.b)("img",Object(s.a)({parentName:"p"},{src:"https://i.imgur.com/tpE2Vs2.png",alt:"Imgur"}))),Object(c.b)("p",null,"In SGD the learning rate ",Object(c.b)("span",Object(s.a)({parentName:"p"},{className:"math math-inline"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-mathml"}),Object(c.b)("math",Object(s.a)({parentName:"span"},{xmlns:"http://www.w3.org/1998/Math/MathML"}),Object(c.b)("semantics",{parentName:"math"},Object(c.b)("mrow",{parentName:"semantics"},Object(c.b)("mi",{parentName:"mrow"},"\u03b1")),Object(c.b)("annotation",Object(s.a)({parentName:"semantics"},{encoding:"application/x-tex"}),"\\alpha")))),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"katex-html","aria-hidden":"true"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"base"}),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"strut",style:{height:"0.43056em",verticalAlign:"0em"}})),Object(c.b)("span",Object(s.a)({parentName:"span"},{className:"mord mathnormal",style:{marginRight:"0.0037em"}}),"\u03b1")))))," is typically much smaller than a corresponding learning rate in batch gradient descent because there is much more variance in the update. Choosing the proper learning rate and schedule (i.e. changing the value of the learning rate as learning progresses) can be fairly difficult. One standard method that works well in practice is to use a small enough constant learning rate that gives stable convergence in the initial epoch (full pass through the training set) or two of training and then halve the value of the learning rate as convergence slows down. An even better approach is to evaluate a held out set after each epoch and anneal the learning rate when the change in objective between epochs is below a small threshold. This tends to give good convergence to a local optima.Generally, the outer loop will iterate over epochs, and for each epoch, we iterates over the dataset in batches as inner loop."),Object(c.b)("h2",{id:"resources"},"Resources"),Object(c.b)("p",null,"Gradient Descent:\n",Object(c.b)("a",Object(s.a)({parentName:"p"},{href:"https://www.youtube.com/watch?v=sDv4f4s2SB8&ab_channel=StatQuestwithJoshStarmer"}),Object(c.b)("img",Object(s.a)({parentName:"a"},{src:"https://i.imgur.com/EWvRCHu.png",alt:"Link for Gradient Descent"})))),Object(c.b)("p",null,"Stochastic Gradient Descent:\n",Object(c.b)("a",Object(s.a)({parentName:"p"},{href:"https://www.youtube.com/watch?v=vMh0zPT0tLI&ab_channel=StatQuestwithJoshStarmer"}),Object(c.b)("img",Object(s.a)({parentName:"a"},{src:"https://i.imgur.com/7okdUGS.png",alt:"Stochastic Gradient Descent"})))),Object(c.b)("p",null,"Writing a training loop from scratch:\n",Object(c.b)("a",Object(s.a)({parentName:"p"},{href:"https://keras.io/guides/writing_a_training_loop_from_scratch/"}),"https://keras.io/guides/writing_a_training_loop_from_scratch/")))}i.isMDXComponent=!0},94:function(e,a,t){"use strict";t.d(a,"a",(function(){return l})),t.d(a,"b",(function(){return j}));var s=t(0),n=t.n(s);function c(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function m(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);a&&(s=s.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,s)}return t}function b(e){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{};a%2?m(Object(t),!0).forEach((function(a){c(e,a,t[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))}))}return e}function p(e,a){if(null==e)return{};var t,s,n=function(e,a){if(null==e)return{};var t,s,n={},c=Object.keys(e);for(s=0;s<c.length;s++)t=c[s],a.indexOf(t)>=0||(n[t]=e[t]);return n}(e,a);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(s=0;s<c.length;s++)t=c[s],a.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}var r=n.a.createContext({}),i=function(e){var a=n.a.useContext(r),t=a;return e&&(t="function"==typeof e?e(a):b(b({},a),e)),t},l=function(e){var a=i(e.components);return n.a.createElement(r.Provider,{value:a},e.children)},o={inlineCode:"code",wrapper:function(e){var a=e.children;return n.a.createElement(n.a.Fragment,{},a)}},O=n.a.forwardRef((function(e,a){var t=e.components,s=e.mdxType,c=e.originalType,m=e.parentName,r=p(e,["components","mdxType","originalType","parentName"]),l=i(t),O=s,j=l["".concat(m,".").concat(O)]||l[O]||o[O]||c;return t?n.a.createElement(j,b(b({ref:a},r),{},{components:t})):n.a.createElement(j,b({ref:a},r))}));function j(e,a){var t=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var c=t.length,m=new Array(c);m[0]=O;var b={};for(var p in a)hasOwnProperty.call(a,p)&&(b[p]=a[p]);b.originalType=e,b.mdxType="string"==typeof e?e:s,m[1]=b;for(var r=2;r<c;r++)m[r]=t[r];return n.a.createElement.apply(null,m)}return n.a.createElement.apply(null,t)}O.displayName="MDXCreateElement"}}]);